Compare commits

..

9 Commits

Author SHA1 Message Date
15560696de Merge pull request #1158 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.28.0
chore(deps): Bump @docker/actions-toolkit from 0.27.0 to 0.28.0
2024-06-26 14:20:37 +02:00
57e1d34ac3 chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-26 14:14:54 +02:00
309982ebc9 chore(deps): Bump @docker/actions-toolkit from 0.27.0 to 0.28.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.27.0 to 0.28.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.27.0...v0.28.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-26 12:10:23 +00:00
9476c25b2a Merge pull request #1153 from crazy-max/export-retention
use default retention days for build export artifact
2024-06-26 14:00:48 +02:00
97be5a4928 chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-24 10:28:21 +02:00
9cac6c8ea0 use default retention days for build export artifact
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-24 10:28:21 +02:00
31159d49c0 Merge pull request #1149 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.27.0
chore(deps): Bump @docker/actions-toolkit from 0.26.2 to 0.27.0
2024-06-20 19:22:45 +02:00
07e1c3e148 chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-20 19:18:43 +02:00
f7febd621d chore(deps): Bump @docker/actions-toolkit from 0.26.2 to 0.27.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.26.2 to 0.27.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.26.2...v0.27.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 17:13:56 +00:00
8 changed files with 98 additions and 22 deletions

View File

@ -1367,3 +1367,32 @@ jobs:
file: ./test/Dockerfile
env:
DOCKER_BUILD_NO_SUMMARY: true
export-retention-days:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
days:
- 2
- 0
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: action
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
driver-opts: |
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
-
name: Build
uses: ./action
with:
file: ./test/Dockerfile
env:
DOCKER_BUILD_EXPORT_RETENTION_DAYS: ${{ matrix.days }}

View File

@ -259,9 +259,10 @@ The following outputs are available:
### environment variables
| Name | Type | Description |
|---------------------------|------|-------------------------------------------------------------------------------------------------------------------|
| `DOCKER_BUILD_NO_SUMMARY` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
| Name | Type | Description |
|--------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `DOCKER_BUILD_NO_SUMMARY` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
| `DOCKER_BUILD_EXPORT_RETENTION_DAYS` | Number | Duration after which build export 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` |
## Troubleshooting

23
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

24
dist/licenses.txt generated vendored
View File

@ -2516,6 +2516,30 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
he
MIT
Copyright Mathias Bynens <https://mathiasbynens.be/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
iconv-lite
MIT
Copyright (c) 2011 Alexander Shtuchkin

View File

@ -27,7 +27,7 @@
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.10.1",
"@docker/actions-toolkit": "0.26.2",
"@docker/actions-toolkit": "0.28.0",
"handlebars": "^4.7.7"
},
"devDependencies": {

View File

@ -151,6 +151,7 @@ actionsToolkit.run(
return;
}
try {
const exportRetentionDays = buildExportRetentionDays();
const buildxHistory = new BuildxHistory();
const exportRes = await buildxHistory.export({
refs: [stateHelper.buildRef]
@ -159,7 +160,7 @@ actionsToolkit.run(
const uploadRes = await GitHub.uploadArtifact({
filename: exportRes.dockerbuildFilename,
mimeType: 'application/gzip',
retentionDays: 90
retentionDays: exportRetentionDays
});
await GitHub.writeBuildSummary({
exportRes: exportRes,
@ -197,3 +198,13 @@ async function buildRef(toolkit: Toolkit, since: Date, builder?: string): Promis
});
return Object.keys(refs).length > 0 ? Object.keys(refs)[0] : '';
}
function buildExportRetentionDays(): number | undefined {
if (process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS) {
const res = parseInt(process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS);
if (isNaN(res)) {
throw Error(`Invalid build export retention days: ${process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS}`);
}
return res;
}
}

View File

@ -1055,9 +1055,9 @@ __metadata:
languageName: node
linkType: hard
"@docker/actions-toolkit@npm:0.26.2":
version: 0.26.2
resolution: "@docker/actions-toolkit@npm:0.26.2"
"@docker/actions-toolkit@npm:0.28.0":
version: 0.28.0
resolution: "@docker/actions-toolkit@npm:0.28.0"
dependencies:
"@actions/artifact": ^2.1.7
"@actions/cache": ^3.2.4
@ -1074,12 +1074,13 @@ __metadata:
csv-parse: ^5.5.6
gunzip-maybe: ^1.4.2
handlebars: ^4.7.8
he: ^1.2.0
js-yaml: ^4.1.0
jwt-decode: ^4.0.0
semver: ^7.6.2
tar-stream: ^3.1.7
tmp: ^0.2.3
checksum: f123f3f1c3369d7557948707e98a0005e43beb4c586f55befc0168426d29cab2ab4daa9dcf114b9e1de45883e2cc42365c69bdca8d61dbb5b2f3241ef4377049
checksum: 1ef7d9eb861a8f102391b9b230a6cfae808ec12f48a97b32e8afe78e241e8d4c1faece71ad8f7702c7b1cfffaf0bd7f816552b6bad0b6d8a41465142a61425a6
languageName: node
linkType: hard
@ -3149,7 +3150,7 @@ __metadata:
resolution: "docker-build-push@workspace:."
dependencies:
"@actions/core": ^1.10.1
"@docker/actions-toolkit": 0.26.2
"@docker/actions-toolkit": 0.28.0
"@types/node": ^20.12.12
"@typescript-eslint/eslint-plugin": ^7.9.0
"@typescript-eslint/parser": ^7.9.0
@ -3962,6 +3963,15 @@ __metadata:
languageName: node
linkType: hard
"he@npm:^1.2.0":
version: 1.2.0
resolution: "he@npm:1.2.0"
bin:
he: bin/he
checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7
languageName: node
linkType: hard
"html-escaper@npm:^2.0.0":
version: 2.0.2
resolution: "html-escaper@npm:2.0.2"