Configuration

Complete reference for all inputs and outputs the AWS CDK Diff GitHub Action accepts.


This section covers everything you can configure in the AWS CDK Diff GitHub Action.

Quick Reference

Inputs

InputRequiredDefaultDescription
diff-fileYes-Path to your CDK diff output file
tokenNogithub.tokenGitHub token for posting comments
headerNo-Custom header for multi-environment setups
aws-regionNo-AWS region to display in the comment

Outputs

OutputDescription
markdownRaw 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!"