From c0f5ce4511b46b8086b039b73347202c9714380b Mon Sep 17 00:00:00 2001 From: smog-root Date: Fri, 18 Oct 2024 14:27:17 +0530 Subject: [PATCH] Implement GitHub PR Issue Checker Workflow --- .github/workflows/pr-checker.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/pr-checker.yml diff --git a/.github/workflows/pr-checker.yml b/.github/workflows/pr-checker.yml new file mode 100644 index 0000000..5b4c111 --- /dev/null +++ b/.github/workflows/pr-checker.yml @@ -0,0 +1,33 @@ +name: PR Issue Checker +# Created my @smog-root. +on: + pull_request: + types: [opened, edited] + +jobs: + check_pr_description: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Check PR Description + id: check_pr_description + run: | + PR_DESCRIPTION="${{ github.event.pull_request.body }}" + if [[ -z "$PR_DESCRIPTION" ]]; then + echo "PR description is missing." + exit 1 + fi + + if [[ ! "$PR_DESCRIPTION" =~ Fixes\ #[0-9]+ ]]; then + echo "The PR description should include 'Fixes #' if not addressing any issue." + echo "##[error]Fixes #NEW must be included in the description." + exit 1 + fi + + echo "PR description is valid." + + - name: Output result + run: echo "All checks passed."