Skip to content

Commit 1dc7386

Browse files
authored
Merge pull request #1364 from crazy-max/history-export-cmd
Bump @docker/actions-toolkit from 0.59.0 to 0.61.0
2 parents 14487ce + 9c9803f commit 1dc7386

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
@@ -1464,6 +1464,35 @@ jobs:
14641464
env:
14651465
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}
14661466

1467+
export-legacy:
1468+
runs-on: ubuntu-latest
1469+
strategy:
1470+
fail-fast: false
1471+
matrix:
1472+
legacy:
1473+
- false
1474+
- true
1475+
steps:
1476+
-
1477+
name: Checkout
1478+
uses: actions/checkout@v4
1479+
with:
1480+
path: action
1481+
-
1482+
name: Set up Docker Buildx
1483+
uses: docker/setup-buildx-action@v3
1484+
with:
1485+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
1486+
driver-opts: |
1487+
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
1488+
-
1489+
name: Build
1490+
uses: ./action
1491+
with:
1492+
file: ./test/Dockerfile
1493+
env:
1494+
DOCKER_BUILD_EXPORT_LEGACY: ${{ matrix.legacy }}
1495+
14671496
checks:
14681497
runs-on: ubuntu-latest
14691498
strategy:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ The following outputs are available:
277277
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
278278
| `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 |
279279
| `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` |
280+
| `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/) |
280281

281282
## Troubleshooting
282283

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": "[email protected]",
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.7"
3232
},
3333
"devDependencies": {

src/main.ts

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

201201
const buildxHistory = new BuildxHistory();
202202
const exportRes = await buildxHistory.export({
203-
refs: stateHelper.buildRef ? [stateHelper.buildRef] : []
203+
refs: stateHelper.buildRef ? [stateHelper.buildRef] : [],
204+
useContainer: buildExportLegacy()
204205
});
205206
core.info(`Build record written to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
206207

@@ -294,3 +295,10 @@ function buildRecordRetentionDays(): number | undefined {
294295
return res;
295296
}
296297
}
298+
299+
function buildExportLegacy(): boolean {
300+
if (process.env.DOCKER_BUILD_EXPORT_LEGACY) {
301+
return Util.parseBool(process.env.DOCKER_BUILD_EXPORT_LEGACY);
302+
}
303+
return false;
304+
}

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,9 +1072,9 @@ __metadata:
10721072
languageName: node
10731073
linkType: hard
10741074

1075-
"@docker/actions-toolkit@npm:0.59.0":
1076-
version: 0.59.0
1077-
resolution: "@docker/actions-toolkit@npm:0.59.0"
1075+
"@docker/actions-toolkit@npm:0.61.0":
1076+
version: 0.61.0
1077+
resolution: "@docker/actions-toolkit@npm:0.61.0"
10781078
dependencies:
10791079
"@actions/artifact": ^2.3.2
10801080
"@actions/cache": ^4.0.3
@@ -1097,7 +1097,7 @@ __metadata:
10971097
semver: ^7.7.1
10981098
tar-stream: ^3.1.7
10991099
tmp: ^0.2.3
1100-
checksum: 0956071aa04e04132b789d47ba57813c566115bea9fdedf3c648d0a0da8ce12350de9cd2a796ce1da7b64b995ae073bfe344b0f63c6f331a45e60195e15680a6
1100+
checksum: 60cc6c8f5bde8221a3d6a40c15258d44a468950353098f1814d8af3a14131df9c41df5b87298cd82f5c77aa4e36e262c15a5bb0cc03ea2857bea18c9e0952d80
11011101
languageName: node
11021102
linkType: hard
11031103

@@ -3143,7 +3143,7 @@ __metadata:
31433143
resolution: "docker-build-push@workspace:."
31443144
dependencies:
31453145
"@actions/core": ^1.11.1
3146-
"@docker/actions-toolkit": 0.59.0
3146+
"@docker/actions-toolkit": 0.61.0
31473147
"@types/node": ^20.12.12
31483148
"@typescript-eslint/eslint-plugin": ^7.9.0
31493149
"@typescript-eslint/parser": ^7.9.0

0 commit comments

Comments
 (0)