-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.32 KB
/
Copy pathcdk_diff.yml
File metadata and controls
77 lines (65 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CDK Diff
on:
pull_request:
jobs:
diff:
name: CDK Diff
runs-on: runs-on
permissions:
id-token: write
contents: read
issues: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c
with:
role-to-assume: "arn:aws:iam::979633842206:role/LocalOfficeSearchApiDeployment"
aws-region: eu-west-1
role-session-name: local-office-search-api-actions-workflow
- uses: citizensadvice/python-poetry-setup-action@a1b420d0c061560845532d7d1f80a81c8f39b6a5
with:
install_cdk: true
project_root: "./cdk"
- name: CDK Diff
id: test-diff
run: |
set -eo pipefail
cd ./cdk
echo "stackdiff<<EOF" >> $GITHUB_OUTPUT
poetry run -- cdk diff 'dev/*' --no-color --ci true | tee &>> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Assemble Comment
id: assemble-comment
run: |
cat << 'EOF' | tee ./comment.md
# Infrastructure Changes
<details>
<summary>Development CDK Diff</summary>
```
${{ steps.test-diff.outputs.stackdiff }}
```
</details>
EOF
- name: Find Comment
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
direction: last
- name: Add New Comment
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
if: steps.find-comment.outputs.comment-id == 0
with:
issue-number: ${{ github.event.pull_request.number }}
body-file: "comment.md"
- name: Update Comment
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
if: steps.find-comment.outputs.comment-id
with:
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body-file: "comment.md"