fix(build-worker): use GitHub PAT from Parameter Store instead of env var#12
Merged
fix(build-worker): use GitHub PAT from Parameter Store instead of env var#12
Conversation
… var - Add getGitHubToken() function to retrieve PAT from common environment - GitHub PAT stored at /laco/cmn/github/pat/cloud-apps (cross-environment) - Support local development with GITHUB_PAT_CLOUD_APPS env var - Remove TODO comments and temporary GITHUB_TOKEN workaround This fixes the SSM parameter access issue where the build worker couldn't access the GitHub PAT needed for repository_dispatch API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR replaces the temporary GITHUB_TOKEN environment variable workaround with proper AWS Systems Manager (SSM) Parameter Store integration for retrieving the GitHub PAT used to trigger repository_dispatch API calls.
Key Changes:
- Added
getGitHubToken()function to retrieve GitHub PAT from SSM Parameter Store path/laco/cmn/github/pat/cloud-apps - Removed TODO comments and temporary environment variable workaround in build worker
- Supports local development via
GITHUB_PAT_CLOUD_APPSenvironment variable
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
applications/chatops/slack-bot/src/shared/secrets.ts |
Adds new getGitHubToken() function to retrieve GitHub PAT from common SSM parameter path with local development fallback |
applications/chatops/slack-bot/src/workers/build/index.ts |
Replaces temporary GITHUB_TOKEN environment variable with proper getGitHubToken() call and removes TODO comments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
llama90
commented
Dec 30, 2025
Contributor
- Initial plan - feat: add caching to getGitHubToken() function - fix: use parameterPath variable instead of hardcoded value in log --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: llama90 <6668548+llama90@users.noreply.github.com>
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
Fixes SSM parameter access issue where build worker couldn't retrieve GitHub PAT for repository_dispatch API.
Problem
Build worker was using a temporary
GITHUB_TOKENenvironment variable workaround because SSM parameter access wasn't implemented.Solution
Added
getGitHubToken()function/laco/cmn/github/pat/cloud-apps(common environment)getSecret()to avoid environment-specific prefixGITHUB_PAT_CLOUD_APPSenv varCode Changes
getGitHubToken()function with SSM integrationgetGitHubToken()instead of env varIAM Permissions
Requires Lambda IAM role to have SSM parameter access (configured in cloud-sandbox PR):
{ effect = "Allow" actions = ["ssm:GetParameter"] resources = ["arn:aws:ssm:ca-central-1:*:parameter/laco/cmn/github/pat/cloud-apps"] }GitHub PAT Permissions
The PAT must have these permissions (see cloud-control-plane PR for guide):
Testing
✅ Tested via Slack
/buildcommand - successfully triggers GitHub Actions workflowRelated PRs
🤖 Generated with Claude Code