Skip to content

[BUG] test3

[BUG] test3 #1

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."