feat: fetch GitHub App credentials from AWS Secrets Manager via OIDC#2
Closed
derekmisler wants to merge 2 commits intomainfrom
Closed
feat: fetch GitHub App credentials from AWS Secrets Manager via OIDC#2derekmisler wants to merge 2 commits intomainfrom
derekmisler wants to merge 2 commits intomainfrom
Conversation
Replace org-secret lookups with OIDC + Secrets Manager in all reusable
consumer-facing workflows. Each affected job now:
1. Assumes the docker-agent-action IAM role via OIDC (id-token: write)
2. Fetches { app_id, private_key, org_membership_token } from the
docker-agent-action/github-app Secrets Manager secret
3. Passes those values to downstream steps instead of inherited secrets
Affected workflows:
- review-pr.yml (auto-review, manual-review, reply-to-feedback jobs)
- reply-to-feedback.yml (reply job)
- pr-describe.yml (generate-description job)
- security-scan.yml (security-scan job)
- self-review-pr.yml (auto-review, manual-review jobs)
HAS_APP_SECRETS env var changed from dynamic secret check to hardcoded
'true' — credentials are always available via Secrets Manager.
Existing secrets: declarations on workflow_call kept as required: false
for backward compatibility with consumer repos not yet migrated.
TODO_ROLE_ARN must be replaced with the actual IAM role ARN after the
Terraform in docker/infra-terraform is applied.
Assisted-By: docker-agent
…ia OIDC Assisted-By: docker-agent
Owner
Author
|
/review |
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.
What's changing
Replaces the three org-level secrets (
CAGENT_REVIEWER_APP_ID,CAGENT_REVIEWER_APP_PRIVATE_KEY,CAGENT_ORG_MEMBERSHIP_TOKEN) with a single OIDC-based lookup from AWS Secrets Manager. Consumer repos no longer need those secrets configured — they only needid-token: writein their job permissions.Why
Currently every one of the ~40 repos that uses these reusable workflows must have 3 org-level secrets manually configured and kept in sync. This is operationally fragile and creates unnecessary secret sprawl. The new approach:
docker-agent-action/github-appin AWS Secrets ManagerHow it works
Each affected job now:
docker-agent-action-*IAM role via GitHub OIDC (id-token: write)docker-agent-action/github-appfrom Secrets ManagerThe multi-line PEM private key is handled via a randomized heredoc delimiter to prevent content from colliding with the
GITHUB_OUTPUTterminator.Files changed
review-pr.ymlauto-review,manual-review,reply-to-feedbackreply-to-feedback.ymlreplypr-describe.ymlgenerate-descriptionsecurity-scan.ymlsecurity-scanself-review-pr.ymlauto-review,manual-reviewrelease.ymlandupdate-docker-agent-version.ymlare not changed — these are internal automation workflows that use the GitHub App for pushing commits and creating releases, not consumer-facing credential passing.TODO_ROLE_ARNplaceholderThe IAM role ARN is not known until the companion Terraform PR (docker/infra-terraform) is applied. Do not merge this PR until:
TODO_ROLE_ARNin all 5 files is replaced with the actual ARN (e.g.,arn:aws:iam::123456789012:role/docker-agent-action-abc123)Deployment sequence
docker/infra-terraform) → creates IAM role + Secrets Manager secret shellaws secretsmanager put-secret-value --secret-id docker-agent-action/github-app --secret-string '{"app_id":"...","private_key":"...","org_membership_token":"..."}'TODO_ROLE_ARNin this PR with the output ARN from step 1cagent-action→docker-agent-action(OIDC scope already usesrepo:docker/*:*so the rename is safe)id-token: writeto the calling job; the 3 secrets can be removed from their config at any time (kept asrequired: falsefor backward compat)Consumer repo changes required