Use GitHub App token instead of PAT in update-documentation workflow - #428
Merged
Conversation
victoriamaciver
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the
devcontainers-repos-automationGitHub App token instead of a PATWhat
Replaces the fine-grained PAT (
secrets.PAT) in.github/workflows/update-documentation.ymlwith a short-lived GitHub App installation token minted at runtime viaactions/create-github-app-token.Why
Microsoft open source now caps PAT lifetime at 8 days (down from 3 months), which would force an 8-day rotation cadence. The App private key has no forced expiry, and the installation token it mints is automatically short-lived (~1h) and rotated every run. A PR opened under the App identity still triggers downstream required checks (unlike the built-in
GITHUB_TOKEN). See devcontainers/internal#343.This mirrors the change made in
devcontainers/images(see that repo's release-workflow PR).How it works
The
generatejob now:actions/create-github-app-token@v2usingvars.DEVCONTAINERS_REPO_AUTOMATION_ID(org variable) andsecrets.DEVCONTAINERS_REPO_AUTOMATION_PRIVATE_KEY(org secret, scoped to this repo).actions/checkout(sogit pushis attributed to the App) and for thegit push/gh api .../pullsstep in place ofsecrets.PAT.GITHUB_TOKENpermissions reduced tocontents: read(the App token performs all writes).Testing
Validated the App-token setup in
devcontainers/templatesbefore merge using a throwaway push-triggered workflow on a temporary branch (auto-cleaned up — no changes tomain): run 30543176813. It confirmed token minting (installation scoped to this repo), read access,contents: write(created + deleted a temp ref), andpull-requests: write(opened a draft PR viagh api POST /pulls, then auto-closed it and deleted the temporary branches). All test branches and the temporary test PR were closed/deleted; no artifacts remain.Prerequisites
devcontainers-repos-automationGitHub App installed ondevcontainers/templates(Contents R/W, Pull requests R/W, Issues R/W, Metadata R).DEVCONTAINERS_REPO_AUTOMATION_IDand org secretDEVCONTAINERS_REPO_AUTOMATION_PRIVATE_KEYscoped to this repo.Notes / follow-ups
secrets.PATcan be removed from the repo once this is merged and a documentation run is verified green.actions/create-github-app-tokento a full commit SHA if the repo adopts action pinning.