mirror of
https://github.com/docker/bake-action.git
synced 2026-01-22 20:32:21 +01:00
default to git context
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
@@ -69,6 +69,7 @@ jobs:
|
|||||||
name: Build and push
|
name: Build and push
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
@@ -87,6 +88,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
set: |
|
set: |
|
||||||
@@ -108,6 +110,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
-
|
-
|
||||||
@@ -144,10 +147,11 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
|
|
||||||
source:
|
remote:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
@@ -188,6 +192,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test/go
|
workdir: ./test/go
|
||||||
|
source: .
|
||||||
targets: binary
|
targets: binary
|
||||||
provenance: ${{ matrix.attrs }}
|
provenance: ${{ matrix.attrs }}
|
||||||
set: |
|
set: |
|
||||||
@@ -229,6 +234,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test/go
|
workdir: ./test/go
|
||||||
|
source: .
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
sbom: true
|
sbom: true
|
||||||
set: |
|
set: |
|
||||||
@@ -275,6 +281,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test/go
|
workdir: ./test/go
|
||||||
|
source: .
|
||||||
set: |
|
set: |
|
||||||
*.platform=linux/amd64
|
*.platform=linux/amd64
|
||||||
*.output=type=image,"name=localhost:5000/name/app:v1.0.0,localhost:5000/name/app:latest",push=true
|
*.output=type=image,"name=localhost:5000/name/app:v1.0.0,localhost:5000/name/app:latest",push=true
|
||||||
@@ -304,6 +311,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test/group
|
workdir: ./test/group
|
||||||
|
source: .
|
||||||
push: true
|
push: true
|
||||||
set: |
|
set: |
|
||||||
t1.tags=localhost:5000/name/app:t1
|
t1.tags=localhost:5000/name/app:t1
|
||||||
@@ -324,6 +332,7 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
|
|
||||||
@@ -361,6 +370,7 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
targets: app-proxy
|
targets: app-proxy
|
||||||
@@ -396,6 +406,7 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
|
|
||||||
@@ -415,8 +426,6 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
|
||||||
source: "{{defaultContext}}"
|
|
||||||
|
|
||||||
git-context-and-local:
|
git-context-and-local:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -439,7 +448,6 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
source: "{{defaultContext}}"
|
|
||||||
files: |
|
files: |
|
||||||
cwd://${{ steps.meta.outputs.bake-file }}
|
cwd://${{ steps.meta.outputs.bake-file }}
|
||||||
|
|
||||||
@@ -466,6 +474,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test/go
|
workdir: ./test/go
|
||||||
|
source: .
|
||||||
set: |
|
set: |
|
||||||
*.output=type=image,name=localhost:5000/name/app:latest,push=true
|
*.output=type=image,name=localhost:5000/name/app:latest,push=true
|
||||||
*.output=type=docker,name=app:local
|
*.output=type=docker,name=app:local
|
||||||
@@ -509,6 +518,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test/go
|
workdir: ./test/go
|
||||||
|
source: .
|
||||||
targets: image
|
targets: image
|
||||||
load: true
|
load: true
|
||||||
push: true
|
push: true
|
||||||
@@ -563,6 +573,7 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
targets: app
|
targets: app
|
||||||
@@ -666,6 +677,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./lint.hcl
|
./lint.hcl
|
||||||
|
|
||||||
@@ -687,6 +699,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
|
source: .
|
||||||
files: |
|
files: |
|
||||||
./lint.hcl
|
./lint.hcl
|
||||||
env:
|
env:
|
||||||
|
|||||||
168
README.md
168
README.md
@@ -14,8 +14,8 @@ as a high-level build command.
|
|||||||
___
|
___
|
||||||
|
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
* [Path context](#path-context)
|
|
||||||
* [Git context](#git-context)
|
* [Git context](#git-context)
|
||||||
|
* [Path context](#path-context)
|
||||||
* [Summaries](#summaries)
|
* [Summaries](#summaries)
|
||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
@@ -27,19 +27,95 @@ ___
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Path context
|
### Git context
|
||||||
|
|
||||||
By default, this action will use the local bake definition (`source: .`), so
|
Since `v6` this action uses the [Git context](https://docs.docker.com/build/bake/remote-definition/)
|
||||||
you need to use the [`actions/checkout`](https://github.com/actions/checkout/)
|
to build from a remote bake definition by default like the [build-push-action](https://github.com/docker/build-push-action)
|
||||||
action to check out the repository.
|
does. This means that you don't need to use the [`actions/checkout`](https://github.com/actions/checkout/)
|
||||||
|
action to check out the repository as [BuildKit](https://docs.docker.com/build/buildkit/)
|
||||||
|
will do this directly.
|
||||||
|
|
||||||
|
The git reference will be based on the [event that triggered your workflow](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)
|
||||||
|
and will result in the following context: `https://github.com/<owner>/<repo>.git#<ref>`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bake:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/bake-action@v5
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
set: |
|
||||||
|
*.tags=user/app:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Be careful because **any file mutation in the steps that precede the build step
|
||||||
|
will be ignored, including processing of the `.dockerignore` file** since
|
||||||
|
the context is based on the Git reference. However, you can use the
|
||||||
|
[Path context](#path-context) using the [`source` input](#inputs) alongside
|
||||||
|
the [`actions/checkout`](https://github.com/actions/checkout/) action to remove
|
||||||
|
this restriction.
|
||||||
|
|
||||||
|
Default Git context can also be provided using the [Handlebars template](https://handlebarsjs.com/guide/)
|
||||||
|
expression `{{defaultContext}}`. Here we can use it to provide a subdirectory
|
||||||
|
to the default Git context:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/bake-action@v5
|
||||||
|
with:
|
||||||
|
source: "{{defaultContext}}:mysubdir"
|
||||||
|
push: true
|
||||||
|
set: |
|
||||||
|
*.tags=user/app:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Building from the current repository automatically uses the `GITHUB_TOKEN`
|
||||||
|
secret that GitHub [automatically creates for workflows](https://docs.github.com/en/actions/security-guides/automatic-token-authentication),
|
||||||
|
so you don't need to pass that manually. If you want to authenticate against
|
||||||
|
another private repository for remote definitions, you can set the
|
||||||
|
[`BUILDX_BAKE_GIT_AUTH_TOKEN` environment variable](https://docs.docker.com/build/building/variables/#buildx_bake_git_auth_token).
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Supported since Buildx 0.14.0
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/bake-action@v5
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
set: |
|
||||||
|
*.tags=user/app:latest
|
||||||
|
env:
|
||||||
|
BUILDX_BAKE_GIT_AUTH_TOKEN: ${{ secrets.MYTOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Path context
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bake:
|
bake:
|
||||||
@@ -61,82 +137,10 @@ jobs:
|
|||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/bake-action@v5
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
push: true
|
push: true
|
||||||
```
|
set: |
|
||||||
|
*.tags=user/app:latest
|
||||||
### Git context
|
|
||||||
|
|
||||||
Git context can be provided using the [`source` input](#inputs). This means
|
|
||||||
that you don't need to use the [`actions/checkout`](https://github.com/actions/checkout/)
|
|
||||||
action to check out the repository as [BuildKit](https://docs.docker.com/build/buildkit/)
|
|
||||||
will do this directly.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
bake:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/bake-action@v5
|
|
||||||
with:
|
|
||||||
source: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}"
|
|
||||||
push: true
|
|
||||||
```
|
|
||||||
|
|
||||||
Be careful because **any file mutation in the steps that precede the build step
|
|
||||||
will be ignored, including processing of the `.dockerignore` file** since
|
|
||||||
the context is based on the Git reference. However, you can use the
|
|
||||||
[Path context](#path-context) alongside the [`actions/checkout`](https://github.com/actions/checkout/)
|
|
||||||
action to remove this restriction.
|
|
||||||
|
|
||||||
Default Git context can also be provided using the [Handlebars template](https://handlebarsjs.com/guide/)
|
|
||||||
expression `{{defaultContext}}`. Here we can use it to provide a subdirectory
|
|
||||||
to the default Git context:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/bake-action@v5
|
|
||||||
with:
|
|
||||||
source: "{{defaultContext}}:mysubdir"
|
|
||||||
push: true
|
|
||||||
```
|
|
||||||
|
|
||||||
Building from the current repository automatically uses the `GITHUB_TOKEN`
|
|
||||||
secret that GitHub [automatically creates for workflows](https://docs.github.com/en/actions/security-guides/automatic-token-authentication),
|
|
||||||
so you don't need to pass that manually. If you want to authenticate against
|
|
||||||
another private repository for remote definitions, you can set the
|
|
||||||
[`BUILDX_BAKE_GIT_AUTH_TOKEN` environment variable](https://docs.docker.com/build/building/variables/#buildx_bake_git_auth_token).
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Supported since Buildx 0.14.0
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/bake-action@v5
|
|
||||||
with:
|
|
||||||
source: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}"
|
|
||||||
push: true
|
|
||||||
env:
|
|
||||||
BUILDX_BAKE_GIT_AUTH_TOKEN: ${{ secrets.MYTOKEN }}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Summaries
|
## Summaries
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ describe('getArgs', () => {
|
|||||||
0,
|
0,
|
||||||
'0.4.1',
|
'0.4.1',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -150,6 +151,7 @@ describe('getArgs', () => {
|
|||||||
1,
|
1,
|
||||||
'0.8.2',
|
'0.8.2',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -164,6 +166,7 @@ describe('getArgs', () => {
|
|||||||
2,
|
2,
|
||||||
'0.8.2',
|
'0.8.2',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['targets', 'webapp\nvalidate'],
|
['targets', 'webapp\nvalidate'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
@@ -180,6 +183,7 @@ describe('getArgs', () => {
|
|||||||
3,
|
3,
|
||||||
'0.8.2',
|
'0.8.2',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['set', '*.cache-from=type=gha\n*.cache-to=type=gha'],
|
['set', '*.cache-from=type=gha\n*.cache-to=type=gha'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
@@ -197,6 +201,7 @@ describe('getArgs', () => {
|
|||||||
4,
|
4,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -212,6 +217,7 @@ describe('getArgs', () => {
|
|||||||
5,
|
5,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -228,6 +234,7 @@ describe('getArgs', () => {
|
|||||||
6,
|
6,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -244,6 +251,7 @@ describe('getArgs', () => {
|
|||||||
7,
|
7,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -260,6 +268,7 @@ describe('getArgs', () => {
|
|||||||
8,
|
8,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -276,6 +285,7 @@ describe('getArgs', () => {
|
|||||||
9,
|
9,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -296,6 +306,7 @@ describe('getArgs', () => {
|
|||||||
10,
|
10,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -315,7 +326,6 @@ describe('getArgs', () => {
|
|||||||
11,
|
11,
|
||||||
'0.10.0',
|
'0.10.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['source', '{{defaultContext}}'],
|
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
['push', 'false'],
|
['push', 'false'],
|
||||||
@@ -334,6 +344,7 @@ describe('getArgs', () => {
|
|||||||
12,
|
12,
|
||||||
'0.17.0',
|
'0.17.0',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
|
['source', '.'],
|
||||||
['allow', 'network.host'],
|
['allow', 'network.host'],
|
||||||
['load', 'false'],
|
['load', 'false'],
|
||||||
['no-cache', 'false'],
|
['no-cache', 'false'],
|
||||||
@@ -347,6 +358,25 @@ describe('getArgs', () => {
|
|||||||
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`
|
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
13,
|
||||||
|
'0.15.0',
|
||||||
|
new Map<string, string>([
|
||||||
|
['source', '{{defaultContext}}:subdir'],
|
||||||
|
['load', 'false'],
|
||||||
|
['no-cache', 'false'],
|
||||||
|
['push', 'false'],
|
||||||
|
['pull', 'false'],
|
||||||
|
['files', './foo.hcl'],
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'bake',
|
||||||
|
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir',
|
||||||
|
'--file', './foo.hcl',
|
||||||
|
'--metadata-file', metadataJson,
|
||||||
|
'--provenance', `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
|
||||||
|
]
|
||||||
|
],
|
||||||
])(
|
])(
|
||||||
'[%d] given %p with %p as inputs, returns %p',
|
'[%d] given %p with %p as inputs, returns %p',
|
||||||
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
||||||
|
|||||||
@@ -147,6 +147,9 @@ function getSourceInput(name: string): string {
|
|||||||
let source = handlebars.compile(core.getInput(name))({
|
let source = handlebars.compile(core.getInput(name))({
|
||||||
defaultContext: Context.gitContext()
|
defaultContext: Context.gitContext()
|
||||||
});
|
});
|
||||||
|
if (!source) {
|
||||||
|
source = Context.gitContext();
|
||||||
|
}
|
||||||
if (source === '.') {
|
if (source === '.') {
|
||||||
source = '';
|
source = '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user