Skip to content

Commit

Permalink
feat(cd): make environment name configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Dec 12, 2024
1 parent af76848 commit 2470cb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cdk/ContinuousDeployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ export class ContinuousDeployment extends Construct {
{
repository: { owner, repo },
gitHubOICDProviderArn,
environment,
}: {
repository: {
owner: string
repo: string
}
gitHubOICDProviderArn: string
environment?: string
},
) {
super(parent, 'cd')
Expand All @@ -30,7 +32,7 @@ export class ContinuousDeployment extends Construct {
gitHubOIDC.openIdConnectProviderArn,
{
StringEquals: {
[`token.actions.githubusercontent.com:sub`]: `repo:${owner}/${repo}:environment:production`,
[`token.actions.githubusercontent.com:sub`]: `repo:${owner}/${repo}:environment:${environment ?? 'production'}`,
[`token.actions.githubusercontent.com:aud`]: 'sts.amazonaws.com',
},
},
Expand Down

0 comments on commit 2470cb0

Please sign in to comment.