Skip to content

default GITHUB_TOKEN is taking precedence over the app's token#132

Merged
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:default-githubtoken-is-taking-precedence-over-the
Apr 15, 2026
Merged

default GITHUB_TOKEN is taking precedence over the app's token#132
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:default-githubtoken-is-taking-precedence-over-the

Conversation

@derekmisler
Copy link
Copy Markdown
Contributor

@derekmisler derekmisler commented Apr 15, 2026

Related Issues

Closes: https://github.com/docker/gordon/issues/391

Summary

When actions/checkout runs with its default persist-credentials: true, it saves the built-in GITHUB_TOKEN into the local git config. This token takes precedence over the GitHub App token configured by the subsequent Setup credentials step, causing auth failures for operations that need the app's elevated permissions.

This PR fixes the credential precedence issue in release.yml, ensures test.yml builds the action before integration tests, and adds tooling for running workflows locally with act.

Changes

  • .github/workflows/release.yml — added persist-credentials: false to all four actions/checkout steps (release, post-release-update, publish-release, major-publish jobs) so the default GITHUB_TOKEN is not persisted in git config and the app token wins
  • .github/workflows/test.yml — combined the install and build steps (pnpm install --frozen-lockfile && pnpm build) so the action is compiled before the integration test runs
  • scripts/act-local.sh — new helper script for running workflows locally via act; fetches GitHub App credentials from 1Password, generates an installation token via @octokit/auth-app, and passes them to act through a temp env file
  • .actrc — configures act defaults (amd64 architecture, node:24-bookworm image)
  • .gitignore — added act-related temp files (.input, .secrets); .actrc is intentionally committed
  • biome.json — excluded .pnpm-store from linting/formatting

Tip

Comment /review to trigger the PR Reviewer agent for automated feedback.
Comment /describe to generate a PR description.

@derekmisler derekmisler self-assigned this Apr 15, 2026
@derekmisler derekmisler requested a review from a team April 15, 2026 15:00
@derekmisler derekmisler marked this pull request as ready for review April 15, 2026 15:00
Signed-off-by: Derek Misler <derek.misler@docker.com>
@derekmisler derekmisler force-pushed the default-githubtoken-is-taking-precedence-over-the branch from 3508e32 to 6722af9 Compare April 15, 2026 15:49
@derekmisler derekmisler enabled auto-merge (squash) April 15, 2026 15:54
@derekmisler derekmisler merged commit 6d33128 into docker:main Apr 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants