diff --git a/.github/workflows/issue-link-checker.yml b/.github/workflows/issue-link-checker.yml new file mode 100644 index 0000000..3ee7c95 --- /dev/null +++ b/.github/workflows/issue-link-checker.yml @@ -0,0 +1,20 @@ +name: PR Issue Link Checker + +on: + pull_request: + types: [opened, edited, reopened] + +jobs: + check-issue-link: + runs-on: ubuntu-latest + steps: + - name: Check for Issue Link in PR + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issuePattern = /#(\d+)/; + const prBody = context.payload.pull_request.body; + if (!issuePattern.test(prBody)) { + core.setFailed("PR must reference an issue."); + }