diff --git a/.github/workflows/pr-file-check.yml b/.github/workflows/pr-file-check.yml index 4e32915955ea..dc64e9913343 100644 --- a/.github/workflows/pr-file-check.yml +++ b/.github/workflows/pr-file-check.yml @@ -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/check-for-changed-files@v1.2.1 with: @@ -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) {