cdklabs / cdklabs/cdk-pipelines-github
`diffProtection` does not work when stack contains tokens
- Dominant language
- TypeScript
- Stars
- 384
- Forks
- 45
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 4
Description
The line: https://github.com/cdklabs/cdk-pipelines-github/blob/main/src/pipeline.ts#L300 does not seem to work when the stack contains tokens.
For example. I create the GitHub OIDC role in an app in my root CDK template, and pass this in to my `GitHubWorkflow.gitHubActionRoleArn` variable. When running the `cdk synth` in GHA, I get an error:
```
Please commit the updated workflow file
```
Which is caused because the workflow appears different because the tokens have changed:
```
- role-to-assume: ${Token[TOKEN.227]}
+ role-to-assume: ${Token[TOKEN.234]}
```
This happens even though the template generates properly in the actual workflow file.
Is there a way to fix this? (Apart from setting `"cdk-pipelines-github:diffProtection": false` in my `cdk.json`)
Contributor guide
Assessment
This issue has not been assessed yet.