{"id":17532819,"url":"https://github.com/blackboard-innersource/gh-action-cdk-diff","last_synced_at":"2025-03-06T12:31:17.302Z","repository":{"id":40365006,"uuid":"295854759","full_name":"blackboard-innersource/gh-action-cdk-diff","owner":"blackboard-innersource","description":"GitHub Action to diff two cdk.out directories.","archived":false,"fork":false,"pushed_at":"2025-02-28T22:35:02.000Z","size":33,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T00:29:55.005Z","etag":null,"topics":["aws-cdk","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blackboard-innersource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-15T21:36:15.000Z","updated_at":"2024-10-16T00:09:16.000Z","dependencies_parsed_at":"2024-02-22T19:30:14.581Z","dependency_job_id":"8974adb4-db2a-4597-a0e3-59db68dba0f9","html_url":"https://github.com/blackboard-innersource/gh-action-cdk-diff","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackboard-innersource%2Fgh-action-cdk-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackboard-innersource%2Fgh-action-cdk-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackboard-innersource%2Fgh-action-cdk-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackboard-innersource%2Fgh-action-cdk-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blackboard-innersource","download_url":"https://codeload.github.com/blackboard-innersource/gh-action-cdk-diff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242211242,"owners_count":20090235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cdk","github-actions"],"created_at":"2024-10-20T18:03:27.645Z","updated_at":"2025-03-06T12:31:17.280Z","avatar_url":"https://github.com/blackboard-innersource.png","language":"Shell","funding_links":[],"categories":["github-actions"],"sub_categories":[],"readme":"![CD Workflow](https://github.com/blackboard-innersource/gh-action-cdk-diff/workflows/CD%20Workflow/badge.svg)\n\n# GitHub Action: CDK Diff\n\nDiff two `cdk.out` directories.\n\n## Usage\n\nFor all possible inputs and outputs see the [Action YAML](action.yml) file.\n\n### Usage: Comment on Pull Request\n\nThis action is most useful for generating a diff of the generated CDK cloud assembly whenever you submit a pull request.\nHere is an example workflow:\n\n```yaml\nname: pr\n\non:\n  pull_request:\n    branches:\n      - master\n\n# Needed because a merge commit could be generated and needs an author\nenv:\n  GIT_AUTHOR_NAME: github-actions[bot]\n  GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com\n  GIT_COMMITTER_NAME: GitHub\n  GIT_COMMITTER_EMAIL: noreply@github.com\n\njobs:\n  cdk-diff:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Setup NodeJS\n        uses: actions/setup-node@v4\n        with:\n          node-version: \"18\"\n\n      # Modify or remove based on your CDK language\n      - name: Setup Python\n        uses: actions/setup-python@v5\n        with:\n          python-version: \"3.11\"\n\n      - name: Install CDK\n        run: npm install -g aws-cdk@2\n\n      - name: Checkout main\n        uses: actions/checkout@v4\n        with:\n          ref: main\n          fetch-depth: 0\n\n      # Modify based on how your project installs dependencies\n      - name: Install main dependencies\n        run: pip install pip-tools \u0026\u0026 pip-sync\n\n      - name: CDK synth main\n        run: cdk synth -o base.cdk.out\n\n      - name: Checkout PR branch\n        uses: actions/checkout@v4\n        with:\n          ref: ${{ github.head_ref }}\n          fetch-depth: 0\n          clean: false\n\n      - name: Merge main to PR branch\n        run: git merge origin/main\n\n      # Modify based on how your project installs dependencies\n      - name: Install PR branch dependencies\n        run: pip-sync\n\n      - name: CDK synth PR branch\n        run: cdk synth -o head.cdk.out\n\n      - name: Diff CDK synth outputs\n        id: diff\n        uses: blackboard-innersource/gh-action-cdk-diff@v1\n        with:\n          # Ignore the S3Key key in the diff. This helps reduce noise in the diff.\n          ignore-keys: S3Key\n\n      - name: Find Comment\n        uses: peter-evans/find-comment@v3\n        id: fc\n        with:\n          issue-number: ${{ github.event.pull_request.number }}\n          comment-author: \"github-actions[bot]\"\n          body-includes: CloudFormation\n\n      - name: Create or update comment\n        uses: peter-evans/create-or-update-comment@v4\n        with:\n          comment-id: ${{ steps.fc.outputs.comment-id }}\n          issue-number: ${{ github.event.pull_request.number }}\n          body-path: ${{ steps.diff.outputs.comment_file }}\n          edit-mode: replace\n```\n\nOverall, what this workflow is doing:\n\n- Running `cdk synth` on the `main` branch.\n- Running `cdk synth` on the pull request branch.\n- Diffing the outputs of those two synths.\n- Posting new or updating existing comment in the pull request with the diff.\n\nYou can also only comment on the pull request when there is a diff by using `if`:\n\n```yaml\n- name: Comment on Pull Request\n  if: steps.diff.outputs.has_diff == 1\n  # etc...\n```\n\n## Developing\n\nTo run tests locally:\n\n```shell script\nmake\n```\n\n## License\n\nPlease see the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackboard-innersource%2Fgh-action-cdk-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackboard-innersource%2Fgh-action-cdk-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackboard-innersource%2Fgh-action-cdk-diff/lists"}