This section covers everything you can configure in the AWS CDK Diff GitHub Action.
Quick Reference
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
diff-file | Yes | - | Path to your CDK diff output file |
token | No | github.token | GitHub token for posting comments |
header | No | - | Custom header for multi-environment setups |
aws-region | No | - | AWS region to display in the comment |
Outputs
| Output | Description |
|---|---|
markdown | Raw markdown of the formatted diff |
empty | 'true' if no changes, 'false' if changes exist |
Detailed Reference
For complete documentation on each input and output, including:
- Usage examples for every parameter
- Best practices for multi-environment setups
- How to use outputs for conditional logic
- Permission requirements
See the Inputs & Outputs reference.
Common Patterns
Simple usage (just the required input):
- uses: towardsthecloud/aws-cdk-diff-pr-commenter@v1
with:
diff-file: cdk-diff-output.txt
With region display:
- uses: towardsthecloud/aws-cdk-diff-pr-commenter@v1
with:
diff-file: cdk-diff-output.txt
aws-region: us-east-1
Multi-environment with headers:
- uses: towardsthecloud/aws-cdk-diff-pr-commenter@v1
with:
diff-file: dev-diff.txt
header: "Dev Environment"
aws-region: us-east-1
- uses: towardsthecloud/aws-cdk-diff-pr-commenter@v1
with:
diff-file: prod-diff.txt
header: "Production Environment"
aws-region: eu-west-1
Conditional logic with outputs:
- name: Post CDK Diff
id: cdk-diff
uses: towardsthecloud/aws-cdk-diff-pr-commenter@v1
with:
diff-file: cdk-diff-output.txt
- name: Check for changes
if: steps.cdk-diff.outputs.empty == 'false'
run: echo "Infrastructure changes detected!"
Related
- Usage Examples - Complete workflow examples
- Install Guide - Setup and troubleshooting