Skip to content

Commit 5dd4f8e

Browse files
authored
Merge pull request #285 from crazy-max/revert-git-auth-token
Revert "set GIT_AUTH_TOKEN secret if Git context used"
2 parents 5a1b7c9 + 8342e48 commit 5dd4f8e

File tree

5 files changed

+3
-17
lines changed

5 files changed

+3
-17
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,6 @@ jobs:
729729
name: Build
730730
uses: ./
731731
with:
732-
source: .
733732
files: |
734733
./test/config.hcl
735734
allow: network.host

dist/index.js

Lines changed: 1 addition & 1 deletion
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.

src/context.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ export function sanitizeInputs(inputs: Inputs) {
6868
return res;
6969
}
7070

71-
export function getGitAuthToken(inputs: Inputs): string {
72-
return process.env.BUILDX_BAKE_GIT_AUTH_TOKEN ?? inputs['github-token'];
73-
}
74-
7571
export async function getArgs(inputs: Inputs, definition: BakeDefinition, toolkit: Toolkit): Promise<Array<string>> {
7672
// prettier-ignore
7773
return [
@@ -101,15 +97,6 @@ async function getBakeArgs(inputs: Inputs, definition: BakeDefinition, toolkit:
10197
await Util.asyncForEach(inputs.set, async set => {
10298
args.push('--set', set);
10399
});
104-
if (await toolkit.buildx.versionSatisfies('<0.20.0')) {
105-
// For buildx versions < 0.20.0, we need to set GIT_AUTH_TOKEN secret as it
106-
// doesn't infer BUILDX_BAKE_GIT_AUTH_TOKEN environment variable for build
107-
// request: https://github.com/docker/buildx/pull/2905
108-
const gitAuthToken = getGitAuthToken(inputs);
109-
if (gitAuthToken && !Bake.hasGitAuthTokenSecret(definition) && inputs.source.startsWith(Context.gitContext())) {
110-
args.push('--set', `*.secrets=${Build.resolveSecretString(`GIT_AUTH_TOKEN=${gitAuthToken}`)}`);
111-
}
112-
}
113100
if (await toolkit.buildx.versionSatisfies('>=0.6.0')) {
114101
args.push('--metadata-file', toolkit.buildxBake.getMetadataFilePath());
115102
}

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ actionsToolkit.run(
3030
stateHelper.setInputs(inputs);
3131

3232
const toolkit = new Toolkit();
33-
const gitAuthToken = context.getGitAuthToken(inputs);
33+
const gitAuthToken = process.env.BUILDX_BAKE_GIT_AUTH_TOKEN ?? inputs['github-token'];
3434

3535
await core.group(`GitHub Actions runtime token ACs`, async () => {
3636
try {

0 commit comments

Comments
 (0)