Skip to content

Commit 212c367

Browse files
authored
Merge pull request #325 from crazy-max/history-export-cmd
Bump @docker/actions-toolkit from 0.59.0 to 0.61.0
2 parents 76f9fa3 + d1ecc3a commit 212c367

File tree

7 files changed

+48
-10
lines changed

7 files changed

+48
-10
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,35 @@ jobs:
653653
env:
654654
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}
655655

656+
export-legacy:
657+
runs-on: ubuntu-latest
658+
strategy:
659+
fail-fast: false
660+
matrix:
661+
legacy:
662+
- false
663+
- true
664+
steps:
665+
-
666+
name: Checkout
667+
uses: actions/checkout@v4
668+
-
669+
name: Set up Docker Buildx
670+
uses: docker/setup-buildx-action@v3
671+
with:
672+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
673+
driver-opts: |
674+
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
675+
-
676+
name: Build
677+
uses: ./
678+
with:
679+
files: |
680+
./test/config.hcl
681+
targets: app
682+
env:
683+
DOCKER_BUILD_EXPORT_LEGACY: ${{ matrix.legacy }}
684+
656685
checks:
657686
runs-on: ubuntu-latest
658687
strategy:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ The following outputs are available
230230
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
231231
| `DOCKER_BUILD_RECORD_UPLOAD` | Bool | `true` | If `false`, build record upload as [GitHub artifact](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts) is disabled |
232232
| `DOCKER_BUILD_RECORD_RETENTION_DAYS` | Number | | Duration after which build record artifact will expire in days. Defaults to repository/org [retention settings](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) if unset or `0` |
233+
| `DOCKER_BUILD_EXPORT_LEGACY` | Bool | `false` | If `true`, exports build using legacy export-build tool instead of [`buildx history export` command](https://docs.docker.com/reference/cli/docker/buildx/history/export/) |
233234

234235
## Subactions
235236

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"packageManager": "yarn@3.6.3",
2828
"dependencies": {
2929
"@actions/core": "^1.11.1",
30-
"@docker/actions-toolkit": "^0.59.0",
30+
"@docker/actions-toolkit": "^0.61.0",
3131
"handlebars": "^4.7.8"
3232
},
3333
"devDependencies": {

src/main.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ actionsToolkit.run(
220220

221221
const buildxHistory = new BuildxHistory();
222222
const exportRes = await buildxHistory.export({
223-
refs: stateHelper.buildRefs
223+
refs: stateHelper.buildRefs,
224+
useContainer: buildExportLegacy()
224225
});
225226
core.info(`Build records written to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
226227

@@ -317,3 +318,10 @@ function buildRecordRetentionDays(): number | undefined {
317318
return res;
318319
}
319320
}
321+
322+
function buildExportLegacy(): boolean {
323+
if (process.env.DOCKER_BUILD_EXPORT_LEGACY) {
324+
return Util.parseBool(process.env.DOCKER_BUILD_EXPORT_LEGACY);
325+
}
326+
return false;
327+
}

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,9 +1065,9 @@ __metadata:
10651065
languageName: node
10661066
linkType: hard
10671067

1068-
"@docker/actions-toolkit@npm:^0.59.0":
1069-
version: 0.59.0
1070-
resolution: "@docker/actions-toolkit@npm:0.59.0"
1068+
"@docker/actions-toolkit@npm:^0.61.0":
1069+
version: 0.61.0
1070+
resolution: "@docker/actions-toolkit@npm:0.61.0"
10711071
dependencies:
10721072
"@actions/artifact": ^2.3.2
10731073
"@actions/cache": ^4.0.3
@@ -1090,7 +1090,7 @@ __metadata:
10901090
semver: ^7.7.1
10911091
tar-stream: ^3.1.7
10921092
tmp: ^0.2.3
1093-
checksum: 0956071aa04e04132b789d47ba57813c566115bea9fdedf3c648d0a0da8ce12350de9cd2a796ce1da7b64b995ae073bfe344b0f63c6f331a45e60195e15680a6
1093+
checksum: 60cc6c8f5bde8221a3d6a40c15258d44a468950353098f1814d8af3a14131df9c41df5b87298cd82f5c77aa4e36e262c15a5bb0cc03ea2857bea18c9e0952d80
10941094
languageName: node
10951095
linkType: hard
10961096

@@ -3141,7 +3141,7 @@ __metadata:
31413141
resolution: "docker-buildx-bake@workspace:."
31423142
dependencies:
31433143
"@actions/core": ^1.11.1
3144-
"@docker/actions-toolkit": ^0.59.0
3144+
"@docker/actions-toolkit": ^0.61.0
31453145
"@types/node": ^20.12.12
31463146
"@typescript-eslint/eslint-plugin": ^7.9.0
31473147
"@typescript-eslint/parser": ^7.9.0

0 commit comments

Comments
 (0)