Skip to content

ci(flake-update): use a GitHub App token instead of a PAT#1

Merged
jx-wi merged 1 commit into
mainfrom
ci/flake-update-app-token
Jun 15, 2026
Merged

ci(flake-update): use a GitHub App token instead of a PAT#1
jx-wi merged 1 commit into
mainfrom
ci/flake-update-app-token

Conversation

@jx-wi

@jx-wi jx-wi commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Mint a short-lived (~1h) GitHub App installation token (actions/create-github-app-token, pinned to v3.2.0) for the weekly flake.lock PR instead of a long-lived PAT: no token expiry to silently break the cron run, 1h-scoped tokens rather than a stored secret, and PRs come from the org App identity, not a personal account. Still not GITHUB_TOKEN, so the bot's PR triggers check. Drop the job's GITHUB_TOKEN perms to contents:read (the App token does the branch push + PR creation).

Requires repo config before the next run: a GitHub App (Contents RW + Pull requests RW) installed on this repo, App ID in the APP_ID variable + private key in the APP_PRIVATE_KEY secret.

What & why

Checklist

CI runs nix flake check (host-side guarantees, guest build, shellcheck) automatically. The
full-boot smoke test (tests/boot.sh) needs a real VM and is not in CI — so if your change
touches the guest, wrapper, or boot path, you must run it locally on a Nix+KVM box and paste
the result here. (See CLAUDE.md → "Definition of done".)

  • nix flake check is green (CI on this PR, or run locally)
  • Ran bash tests/boot.sh on a Nix+KVM box — pasted the N passed, M failed line below; or N/A (docs / CI-only change, no guest/wrapper/boot impact)
  • Touches the TTY (zsh/ZLE/terminfo/ssh -tt)? Did a human ccvm --shell pass — resize, vim, less, vi-mode — since terminal fidelity isn't automated
  • Security invariants still hold (no secret to disk/argv/seed; host key pinned; only the CWD shared) — see CLAUDE.md "Security invariants"
  • Commit trailer is the exact ccvm form: Co-authored-by: Claude <noreply@anthropic.com>

Mint a short-lived (~1h) GitHub App installation token (actions/create-github-app-token, pinned to v3.2.0) for the weekly flake.lock PR instead of a long-lived PAT: no token expiry to silently break the cron run, 1h-scoped tokens rather than a stored secret, and PRs come from the org App identity, not a personal account. Still not GITHUB_TOKEN, so the bot's PR triggers `check`. Drop the job's GITHUB_TOKEN perms to contents:read (the App token does the branch push + PR creation).

Requires repo config before the next run: a GitHub App (Contents RW + Pull requests RW) installed on this repo, App ID in the `APP_ID` variable + private key in the `APP_PRIVATE_KEY` secret.

Co-authored-by: Claude <noreply@anthropic.com>
@jx-wi

jx-wi commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

boot.sh N/A

@jx-wi jx-wi merged commit c438dbc into main Jun 15, 2026
1 check passed
@jx-wi jx-wi deleted the ci/flake-update-app-token branch June 15, 2026 20:29
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