Skip to content

Commit e3c2ab5

Browse files
committed
update associated issue check
1 parent 40fd329 commit e3c2ab5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/pr-file-check.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ jobs:
1414
name: 'Check for changed files'
1515
runs-on: ubuntu-latest
1616
steps:
17+
- name: 'Add "issue-please" label'
18+
if: github.event.action == 'opened'
19+
uses: actions/github-script@v6
20+
with:
21+
script: |
22+
github.issues.addLabels({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
issue_number: context.issue.number,
26+
labels: ['issue-please']
27+
})
28+
1729
- name: 'package-lock.json matches package.json'
1830
uses: brettcannon/[email protected]
1931
with:
@@ -46,6 +58,9 @@ jobs:
4658
with:
4759
script: |
4860
const labels = context.payload.pull_request.labels.map(label => label.name);
61+
if (labels.includes('issue-please')) {
62+
core.setFailed('The "issue-please" label is present. Please associate an issue and remove the label.');
63+
}
4964
if (!labels.includes('skip-issue-check')) {
5065
const issueLink = context.payload.pull_request.body.match(/https:\/\/github\.com\/\S+\/issues\/\d+/);
5166
if (!issueLink) {

0 commit comments

Comments
 (0)