-
-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (81 loc) · 2.24 KB
/
pr-comment-test.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: "Test - PR comments"
on:
pull_request: {}
env:
AWS_REGION: us-east-2
# Permissions required for assuming AWS identity
permissions:
id-token: write
contents: read
issues: write
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup
run: echo "Do setup"
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: metadata-${{ github.run_id }}-test-pr-comments
path: ./tests/fixtures/metadata
retention-days: 1
test:
runs-on: ubuntu-latest
continue-on-error: true
needs: [setup]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Plan Atmos Component
id: current
uses: ./
with:
max-opened-issues: '4'
labels: "test-pr-comments"
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
outputs:
result: ${{ steps.current.outcome }}
assert:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: nick-fields/assert-action@v2
with:
expected: 'success'
actual: "${{ needs.test.outputs.result }}"
- name: Find all issues
id: issues
uses: actions-cool/issues-helper@v3
with:
actions: 'find-issues'
token: ${{ github.token }}
labels: 'test-pr-comments'
issue-state: 'open'
- name: Count found issues
id: test
run: |
issue_count=$(echo '${{ steps.issues.outputs.issues }}' | jq '. | length')
echo "Count of found issues: $issue_count"
echo "count=$issue_count" >> $GITHUB_OUTPUT
- uses: nick-fields/assert-action@v2
with:
expected: '4'
actual: "${{ steps.test.outputs.count }}"
teardown:
runs-on: ubuntu-latest
needs: [assert]
if: ${{ always() }}
steps:
- name: Tear down
run: echo "Do Tear down"
- name: Close all matching issues
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issues'
token: ${{ github.token }}
labels: 'test-pr-comments'