Skip to content

ci: fix update-flake-lock workflow (app token + update-flake-lock action)#2281

Open
brainrake wants to merge 2 commits into
developfrom
fix/update-flake-lock-checkout-auth
Open

ci: fix update-flake-lock workflow (app token + update-flake-lock action)#2281
brainrake wants to merge 2 commits into
developfrom
fix/update-flake-lock-checkout-auth

Conversation

@brainrake

@brainrake brainrake commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

The update-flake-lock workflow has failed on every run. Two issues:

  1. Duplicate Authorization header → HTTP 400. actions/checkout@v6 persists a credential auth header that collides with the one the PR-creation step sets.
  2. GitHub Actions is not permitted to create or approve pull requests. The org disables that policy, so GITHUB_TOKEN can't open the PR regardless of workflow permissions.

Fix

  • Switch to DeterminateSystems/update-flake-lock for better ergonomics (handles the nix flake update + PR in one step).
  • Authenticate with a GitHub App token via actions/create-github-app-token, which is not subject to the org policy. This also means PRs trigger CI (unlike GITHUB_TOKEN-created PRs).

Requires (before merge)

A Supabase-owned GitHub App with Contents: R/W and Pull requests: R/W, installed on this repo, plus repo secrets:

  • UPDATE_APP_ID
  • UPDATE_APP_PRIVATE_KEY

🤖 Generated with Claude Code

checkout@v6 persists credentials that collide with the auth header set
by create-pull-request, producing a duplicate Authorization header and
a HTTP 400 on push. Disable credential persistence since
create-pull-request supplies its own token.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@brainrake
brainrake requested review from a team as code owners July 15, 2026 13:25
@brainrake

brainrake commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Switch to DeterminateSystems/update-flake-lock for better ergonomics and
authenticate via actions/create-github-app-token. A GitHub App token is
required because the org disables "Allow GitHub Actions to create and
approve pull requests", so GITHUB_TOKEN cannot open the PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@brainrake brainrake changed the title ci: fix update-flake-lock PR creation (duplicate auth header) ci: fix update-flake-lock workflow (app token + update-flake-lock action) Jul 16, 2026
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.

1 participant