Skip to content

Commit de9f807

Browse files
committed
Create pr_check.yml
1 parent 3c0320b commit de9f807

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/pr_check.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 grep -q '- \[ \]' issue_body.json; then
28+
echo "unchecked=true" >> $GITHUB_ENV
29+
echo "Unchecked checkboxes found!"
30+
else
31+
echo "unchecked=false" >> $GITHUB_ENV
32+
fi
33+
34+
- name: Comment on Issue if unchecked checkboxes are found
35+
if: ${{ env.unchecked == 'true' && env.missing_transcript == 'true' }}
36+
uses: peter-evans/create-or-update-comment@v4
37+
with:
38+
issue-number: ${{ github.event.issue.number }}
39+
body: |
40+
⚠️ It looks like some checkboxes in your issue are not checked.
41+
Please ensure you have confirmed all the checkboxes are valid before opening an issue.
42+
The issue will be closed if the checkboxes are not checked.

0 commit comments

Comments
 (0)