mirror of
https://github.com/docker/bake-action.git
synced 2026-06-05 17:48:40 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60f5d53310 | |||
| cb84b96ea2 | |||
| 63a0b90c7c | |||
| 5dd4f8e2d6 | |||
| 8342e4814b | |||
| 4e1bb14d4e |
@@ -729,7 +729,6 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
source: .
|
|
||||||
files: |
|
files: |
|
||||||
./test/config.hcl
|
./test/config.hcl
|
||||||
allow: network.host
|
allow: network.host
|
||||||
|
|||||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -27,7 +27,7 @@
|
|||||||
"packageManager": "yarn@3.6.3",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@docker/actions-toolkit": "^0.50.0",
|
"@docker/actions-toolkit": "^0.51.0",
|
||||||
"handlebars": "^4.7.8"
|
"handlebars": "^4.7.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -68,10 +68,6 @@ export function sanitizeInputs(inputs: Inputs) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGitAuthToken(inputs: Inputs): string {
|
|
||||||
return process.env.BUILDX_BAKE_GIT_AUTH_TOKEN ?? inputs['github-token'];
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getArgs(inputs: Inputs, definition: BakeDefinition, toolkit: Toolkit): Promise<Array<string>> {
|
export async function getArgs(inputs: Inputs, definition: BakeDefinition, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
return [
|
return [
|
||||||
@@ -101,15 +97,6 @@ async function getBakeArgs(inputs: Inputs, definition: BakeDefinition, toolkit:
|
|||||||
await Util.asyncForEach(inputs.set, async set => {
|
await Util.asyncForEach(inputs.set, async set => {
|
||||||
args.push('--set', set);
|
args.push('--set', set);
|
||||||
});
|
});
|
||||||
if (await toolkit.buildx.versionSatisfies('<0.20.0')) {
|
|
||||||
// For buildx versions < 0.20.0, we need to set GIT_AUTH_TOKEN secret as it
|
|
||||||
// doesn't infer BUILDX_BAKE_GIT_AUTH_TOKEN environment variable for build
|
|
||||||
// request: https://github.com/docker/buildx/pull/2905
|
|
||||||
const gitAuthToken = getGitAuthToken(inputs);
|
|
||||||
if (gitAuthToken && !Bake.hasGitAuthTokenSecret(definition) && inputs.source.startsWith(Context.gitContext())) {
|
|
||||||
args.push('--set', `*.secrets=${Build.resolveSecretString(`GIT_AUTH_TOKEN=${gitAuthToken}`)}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (await toolkit.buildx.versionSatisfies('>=0.6.0')) {
|
if (await toolkit.buildx.versionSatisfies('>=0.6.0')) {
|
||||||
args.push('--metadata-file', toolkit.buildxBake.getMetadataFilePath());
|
args.push('--metadata-file', toolkit.buildxBake.getMetadataFilePath());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ actionsToolkit.run(
|
|||||||
stateHelper.setInputs(inputs);
|
stateHelper.setInputs(inputs);
|
||||||
|
|
||||||
const toolkit = new Toolkit();
|
const toolkit = new Toolkit();
|
||||||
const gitAuthToken = context.getGitAuthToken(inputs);
|
const gitAuthToken = process.env.BUILDX_BAKE_GIT_AUTH_TOKEN ?? inputs['github-token'];
|
||||||
|
|
||||||
await core.group(`GitHub Actions runtime token ACs`, async () => {
|
await core.group(`GitHub Actions runtime token ACs`, async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1066,9 +1066,9 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@docker/actions-toolkit@npm:^0.50.0":
|
"@docker/actions-toolkit@npm:^0.51.0":
|
||||||
version: 0.50.0
|
version: 0.51.0
|
||||||
resolution: "@docker/actions-toolkit@npm:0.50.0"
|
resolution: "@docker/actions-toolkit@npm:0.51.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/artifact": ^2.2.1
|
"@actions/artifact": ^2.2.1
|
||||||
"@actions/cache": ^3.3.0
|
"@actions/cache": ^3.3.0
|
||||||
@@ -1091,7 +1091,7 @@ __metadata:
|
|||||||
semver: ^7.6.3
|
semver: ^7.6.3
|
||||||
tar-stream: ^3.1.7
|
tar-stream: ^3.1.7
|
||||||
tmp: ^0.2.3
|
tmp: ^0.2.3
|
||||||
checksum: dc1b0323f142f96cbac47be327ebdbc9038a8835f32f174e24c3d8113df03ca6fb034be6ffadeab1e1d234ccd6931e09915c96a8732065e35a576e459d3471ff
|
checksum: 03d25e8896fed69db608aad58995a41f57325c1e26c197040990c671dfbdeddd2483028d24c2d4505c010a87992780ee09d9e1f1141dda5662857050d644a99b
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -3159,7 +3159,7 @@ __metadata:
|
|||||||
resolution: "docker-buildx-bake@workspace:."
|
resolution: "docker-buildx-bake@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core": ^1.11.1
|
"@actions/core": ^1.11.1
|
||||||
"@docker/actions-toolkit": ^0.50.0
|
"@docker/actions-toolkit": ^0.51.0
|
||||||
"@types/node": ^20.12.12
|
"@types/node": ^20.12.12
|
||||||
"@typescript-eslint/eslint-plugin": ^7.9.0
|
"@typescript-eslint/eslint-plugin": ^7.9.0
|
||||||
"@typescript-eslint/parser": ^7.9.0
|
"@typescript-eslint/parser": ^7.9.0
|
||||||
|
|||||||
Reference in New Issue
Block a user