Skip to content

Commit 4eda232

Browse files
committed
mark buildx >= 0.20.0 as incompatible with docker/bake-action < v6
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent a99697d commit 4eda232

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ on:
3232
- 'subaction/**'
3333

3434
env:
35-
BUILDX_VERSION: latest
35+
BUILDX_VERSION: v0.18.0
3636
BUILDKIT_IMAGE: moby/buildkit:buildx-stable-1
3737

3838
jobs:
@@ -153,6 +153,11 @@ jobs:
153153
-
154154
name: Checkout
155155
uses: actions/checkout@v4
156+
-
157+
name: Set up Docker Buildx
158+
uses: docker/setup-buildx-action@v3
159+
with:
160+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
156161
-
157162
name: Build
158163
uses: ./
@@ -522,3 +527,31 @@ jobs:
522527
name: Check docker
523528
run: |
524529
docker image inspect localhost:5000/name/app:latest
530+
531+
error-buildx-latest:
532+
runs-on: ubuntu-latest
533+
steps:
534+
-
535+
name: Checkout
536+
uses: actions/checkout@v4
537+
-
538+
name: Set up Docker Buildx
539+
uses: docker/setup-buildx-action@v3
540+
with:
541+
version: v0.20.0
542+
-
543+
name: Build
544+
id: bake
545+
continue-on-error: true
546+
uses: ./
547+
with:
548+
files: |
549+
./test/config.hcl
550+
-
551+
name: Check
552+
run: |
553+
echo "${{ toJson(steps.bake) }}"
554+
if [ "${{ steps.bake.outcome }}" != "failure" ] || [ "${{ steps.bake.conclusion }}" != "success" ]; then
555+
echo "::error::Should have failed"
556+
exit 1
557+
fi

src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ actionsToolkit.run(
2020
async () => {
2121
const inputs: context.Inputs = await context.getInputs();
2222
const toolkit = new Toolkit();
23+
if (await toolkit.buildx.versionSatisfies('>=0.20.0')) {
24+
throw new Error('docker/bake-action < v6 is not compatible with buildx >= 0.20.0, please update your workflow to latest docker/bake-action or use an older buildx version.');
25+
}
26+
2327
const gitAuthToken = process.env.BUILDX_BAKE_GIT_AUTH_TOKEN ?? inputs['github-token'];
2428

2529
await core.group(`GitHub Actions runtime token ACs`, async () => {

0 commit comments

Comments
 (0)