[BUG] test3 #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Issue | |
on: | |
issues: | |
types: [opened, edited] | |
jobs: | |
check_issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if issue body contains the checkbox | |
id: check | |
run: | | |
if ! echo "${{ github.event.issue.body }}" | grep -q '\- \[x\] I confirm that I have completed all the steps'; then | |
echo "Checkbox is not checked" | |
exit 1 | |
fi | |
- name: Add comment if the checkbox is not checked | |
if: failure() | |
run: | | |
gh issue comment ${{ github.event.issue.number }} --body "Please check the required checkbox to confirm you have completed all the steps." | |
- name: Close issue if the checkbox is not checked | |
if: failure() | |
run: | | |
gh issue close ${{ github.event.issue.number }} --comment "Closing the issue as the required checkbox was not marked." |