feat: switch GitHub credentials to PAT from AWS secret#174
Merged
Conversation
Replaces the GitHub App (app_id + private_key) credential flow with a PAT stored directly in the AWS secret. The secret now holds two fields: - `pat`: a repo-scoped PAT exported as GITHUB_APP_TOKEN - `org_membership_token`: an admin-scoped token exported as ORG_MEMBERSHIP_TOKEN Removes app-token.ts (and its tests) which generated an installation token via `@octokit/auth-app` — no longer needed since the PAT is fetched directly. Both fields are required; the action fails hard if either is absent. Refs docker/gordon#500 Assisted-By: docker-agent
Assisted-By: docker-agent
Assisted-By: docker-agent
Assisted-By: docker-agent
Assisted-By: docker-agent
Assisted-By: docker-agent
Assisted-By: docker-agent
Assisted-By: docker-agent
Assisted-By: docker-agent
derekmisler
approved these changes
May 5, 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.
Summary
Replaces the GitHub App (
app_id+private_key) credential flow with a PAT stored directly in the AWS secretdocker-agent-action/github-app.Closes docker/gordon#500
Changes
New secret shape
{ "pat": "...", "org_membership_token": "..." }pat— repo-scoped PAT; exported asGITHUB_APP_TOKENorg_membership_token— admin-scoped token for org user lookups; exported asORG_MEMBERSHIP_TOKEN(unchanged role, kept as a separate field)Both fields are required — the action fails hard if either is absent or empty.
Files changed
src/credentials/github-app.tsGitHubAppSecret→GitHubPATSecret; parsepat+org_membership_token; exportGITHUB_APP_TOKEN= patsrc/credentials/app-token.tssrc/credentials/index.tsgenerateAppToken()import and callsrc/credentials/__tests__/github-app.test.tsVALID_SECRET; new missing-field testssrc/credentials/__tests__/app-token.test.tssrc/credentials/__tests__/app-token.integration.test.tsTest results
Biome CI and tsc pass cleanly.