Skip to content

Commit

Permalink
update associated issue check
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Dec 17, 2024
1 parent 40fd329 commit e3c2ab5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pr-file-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ jobs:
name: 'Check for changed files'
runs-on: ubuntu-latest
steps:
- name: 'Add "issue-please" label'
if: github.event.action == 'opened'
uses: actions/github-script@v6
with:
script: |
github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['issue-please']
})
- name: 'package-lock.json matches package.json'
uses: brettcannon/[email protected]
with:
Expand Down Expand Up @@ -46,6 +58,9 @@ jobs:
with:
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (labels.includes('issue-please')) {
core.setFailed('The "issue-please" label is present. Please associate an issue and remove the label.');
}
if (!labels.includes('skip-issue-check')) {
const issueLink = context.payload.pull_request.body.match(/https:\/\/github\.com\/\S+\/issues\/\d+/);
if (!issueLink) {
Expand Down

0 comments on commit e3c2ab5

Please sign in to comment.