[Bug]: Test bug report labeling #4
This file contains 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
name: Label issues | |
"on": | |
issues: | |
types: | |
- opened | |
# issue_comment is triggered when commenting on both issues and | |
# pull requests. To avoid adding pull requests to the bug board, | |
# filter out pull requests | |
jobs: | |
label_issues: | |
name: Add labels from template response | |
if: ${{ github.event.issue.action == 'opened' }} | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: npm install marked | |
- uses: actions/github-script@v6 | |
env: | |
ISSUE_BODY: ${{ github.event.issue.body }} | |
with: | |
script: | | |
const { ISSUE_BODY } = process.env | |
const re = /[#]{1,3} .*\n\n/; | |
const labels = body.split(re); | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: [ labels[1], labels[2], "installation:" + labels[7], "pgversion:" + labels[5], "tsversion:" + labels[4] ] | |
}) | |