Skip to content

Commit

Permalink
Create issue-link-checker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucca-C authored Jan 22, 2024
1 parent 8026359 commit c14f515
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/issue-link-checker.yml
Original file line number Diff line number Diff line change
@@ -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.");
}

0 comments on commit c14f515

Please sign in to comment.