Compare commits

..

No commits in common. "8e5442c4ef9f78752691e2d8f8d19755c6f78e81" and "41e1fe3437fd5c8d22c24a824307673223ead782" have entirely different histories.

6 changed files with 56 additions and 25 deletions

View File

@ -455,3 +455,29 @@ jobs:
- -
name: Print envs name: Print envs
run: env|sort run: env|sort
bake-cwd:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
-
name: Docker meta
id: docker_meta
uses: ./
-
name: Build
uses: docker/bake-action@v4
with:
files: |
./test/docker-bake.hcl
${{ steps.docker_meta.outputs.bake-file-tags }}
${{ steps.docker_meta.outputs.bake-file-labels }}
targets: |
release

14
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

View File

@ -29,12 +29,12 @@
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",
"@actions/github": "^6.0.0", "@actions/github": "^6.0.0",
"@docker/actions-toolkit": "^0.16.1", "@docker/actions-toolkit": "^0.16.0",
"@renovate/pep440": "^1.0.0", "@renovate/pep440": "^1.0.0",
"csv-parse": "^5.5.3", "csv-parse": "^5.5.3",
"handlebars": "^4.7.8", "handlebars": "^4.7.8",
"moment": "^2.30.1", "moment": "^2.29.4",
"moment-timezone": "^0.5.44", "moment-timezone": "^0.5.43",
"semver": "^7.5.4" "semver": "^7.5.4"
}, },
"devDependencies": { "devDependencies": {

View File

@ -94,17 +94,22 @@ actionsToolkit.run(
setOutput('json', JSON.stringify(jsonOutput)); setOutput('json', JSON.stringify(jsonOutput));
}); });
// Specifying local and remote bake files is supported since Buildx 0.12.0.
// Set cwd:// prefix for local bake files to avoid ambiguity with remote
// https://github.com/docker/buildx/pull/1838
const bakeFileCwdPrefix = (await toolkit.buildx.versionSatisfies('>=0.12.0').catch(() => false)) ? 'cwd://' : '';
// Bake files // Bake files
for (const kind of ['tags', 'labels', 'annotations:' + annotationsLevels]) { for (const kind of ['tags', 'labels', 'annotations:' + annotationsLevels]) {
const outputName = kind.split(':')[0]; const outputName = kind.split(':')[0];
const bakeFile: string = meta.getBakeFile(kind); const bakeFile: string = meta.getBakeFile(kind);
await core.group(`Bake file definition (${outputName})`, async () => { await core.group(`Bake file definition (${outputName})`, async () => {
core.info(fs.readFileSync(bakeFile, 'utf8')); core.info(fs.readFileSync(bakeFile, 'utf8'));
setOutput(`bake-file-${outputName}`, bakeFile); setOutput(`bake-file-${outputName}`, `${bakeFileCwdPrefix}${bakeFile}`);
}); });
} }
// Bake file with tags and labels // Bake file with tags and labels
setOutput(`bake-file`, `${meta.getBakeFileTagsLabels()}`); setOutput(`bake-file`, `${bakeFileCwdPrefix}${meta.getBakeFileTagsLabels()}`);
} }
); );

View File

@ -773,10 +773,10 @@
dependencies: dependencies:
"@jridgewell/trace-mapping" "0.3.9" "@jridgewell/trace-mapping" "0.3.9"
"@docker/actions-toolkit@^0.16.1": "@docker/actions-toolkit@^0.16.0":
version "0.16.1" version "0.16.0"
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.16.1.tgz#797f843acee50dd3e01e976a6305ce57516b7347" resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.16.0.tgz#a070abd4525bd63f1732fed2b95dafc85cbd01b8"
integrity sha512-RVlNRBJLBdRh3SC+GejtT0z47j5GgTc2hA3sNlWXYw7syQJON++/fgqWn7OqjCmT7c9MtdeqxwT3MTx1WvgSsw== integrity sha512-OIowepg3DhO+HSByAcxevzJXmMOgaquxjNlCOVJMt3qK+1tjEZ+9gJ3U3651KELrJf6RrlxSnY7GPipNFB6Vtw==
dependencies: dependencies:
"@actions/cache" "^3.2.2" "@actions/cache" "^3.2.2"
"@actions/core" "^1.10.1" "@actions/core" "^1.10.1"
@ -3353,17 +3353,17 @@ minimist@^1.2.5:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
moment-timezone@^0.5.44: moment-timezone@^0.5.43:
version "0.5.44" version "0.5.43"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.44.tgz#a64a4e47b68a43deeab5ae4eb4f82da77cdf595f" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.43.tgz#3dd7f3d0c67f78c23cd1906b9b2137a09b3c4790"
integrity sha512-nv3YpzI/8lkQn0U6RkLd+f0W/zy/JnoR5/EyPz/dNkPTBjA2jNLCVxaiQ8QpeLymhSZvX0wCL5s27NQWdOPwAw== integrity sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==
dependencies: dependencies:
moment "^2.29.4" moment "^2.29.4"
moment@^2.29.4, moment@^2.30.1: moment@^2.29.4:
version "2.30.1" version "2.29.4"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
ms@2.1.2: ms@2.1.2:
version "2.1.2" version "2.1.2"