diff --git a/.github/workflows/pr-checker.yml b/.github/workflows/pr-checker.yml index 5b4c111..b5c633e 100644 --- a/.github/workflows/pr-checker.yml +++ b/.github/workflows/pr-checker.yml @@ -1,5 +1,4 @@ name: PR Issue Checker -# Created my @smog-root. on: pull_request: types: [opened, edited] @@ -7,27 +6,20 @@ on: jobs: check_pr_description: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Check PR Description id: check_pr_description + env: + PR_DESCRIPTION: ${{ github.event.pull_request.body }} 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." + if [[ ! "$PR_DESCRIPTION" =~ Fixes[[:space:]]#[0-9]+ ]]; then + echo "PR description must include 'Fixes #' (for example: 'Fixes #123')." >&2 exit 1 fi echo "PR description is valid." - - - name: Output result - run: echo "All checks passed."