PEP8 Standard E501 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/wip-on-ref.yml | |
| name: Label linked issues as WIP | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize] | |
| permissions: | |
| issues: write | |
| pull-requests: read | |
| jobs: | |
| label-wip: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add WIP label to linked issues | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const body = context.payload.pull_request.body || ''; | |
| const issuePattern = /refs?\s+#(\d+)/gi; | |
| const matches = [...body.matchAll(issuePattern)]; | |
| if (matches.length === 0) { | |
| console.log('No linked issues found.'); | |
| return; | |
| } | |
| for (const match of matches) { | |
| const issueNumber = parseInt(match[1]); | |
| // Add WIP label (issue stays open, just gets labelled) | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| labels: ['WIP'] | |
| }); | |
| console.log(`Labelled issue #${issueNumber} as WIP`); | |
| } |