File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Check Issue Checkboxes
2+
3+ on :
4+ issues :
5+ types : [opened, edited]
6+
7+ jobs :
8+ check-checkboxes :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Check if Issue has the 'missing transcript' label
13+ id : label-check
14+ run : |
15+ echo "labels=${{ toJson(github.event.issue.labels) }}" > labels.json
16+ if grep -q 'missing transcript' labels.json; then
17+ echo "missing_transcript=true" >> $GITHUB_ENV
18+ else
19+ echo "missing_transcript=false" >> $GITHUB_ENV
20+ fi
21+
22+ - name : Check for unchecked checkboxes
23+ id : check
24+ if : ${{ env.missing_transcript == 'true' }}
25+ run : |
26+ echo "issue_body=${{ toJson(github.event.issue.body) }}" > issue_body.json
27+ # If found any unchecked checkboxes, set output to true
28+ if grep -q '- \[ \]' issue_body.json; then
29+ echo "unchecked=true" >> $GITHUB_ENV
30+ echo "Unchecked checkboxes found!"
31+ else
32+ echo "unchecked=false" >> $GITHUB_ENV
33+ fi
34+
35+ - name : Comment on Issue if unchecked checkboxes are found
36+ if : ${{ env.unchecked == 'true' && env.missing_transcript == 'true' }}
37+ uses : peter-evans/create-or-update-comment@v4
38+ with :
39+ issue-number : ${{ github.event.issue.number }}
40+ body : |
41+ ⚠️ It looks like some checkboxes in your issue are not checked.
42+ Please ensure you have confirmed all the checkboxes are valid before opening an issue.
43+ The issue will be closed if the checkboxes are not checked.
You can’t perform that action at this time.
0 commit comments