Skip to content

chore(nbs): drop ubcpdk, use generic PDK #193

chore(nbs): drop ubcpdk, use generic PDK

chore(nbs): drop ubcpdk, use generic PDK #193

Workflow file for this run

name: PR Labeler
on:
# pull_request_target so the job still gets a write-scoped token on PRs from
# forks (a plain pull_request token is read-only there, and addLabels 403s).
# Safe here: nothing from the PR is checked out or executed, the title is
# only regex-tested, and the job stays read-only towards code.
pull_request_target:
types: [opened, edited]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/github-script@v7
with:
script: |
const title = context.payload.pull_request.title;
const labels = [];
if (/^feat(\(.*?\))?[:!]/.test(title)) labels.push('enhancement');
else if (/^fix(\(.*?\))?[:!]/.test(title)) labels.push('bug');
else if (/^docs(\(.*?\))?[:!]/.test(title)) labels.push('documentation');
else if (/^refactor(\(.*?\))?[:!]/.test(title)) labels.push('refactor');
if (labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels,
});
}