Skip to content

tech/fix-pack-ids : resolve missing id for pack #1735

tech/fix-pack-ids : resolve missing id for pack

tech/fix-pack-ids : resolve missing id for pack #1735

name: Label and assign PRs
on:
pull_request:
branches: ['develop']
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/github-script@v6
with:
script: |
const labelMap = new Map([
["feat", ["enhancement"]],
["fix", ["bug"]],
["test", ["coverage"]],
["refactor", ["refactor"]],
["chore", ["task"]],
]);
const labels = labelMap.get(context.payload.pull_request.title.split("(")[0])
if (labels) {
github.rest.issues.addLabels({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels,
});
} else {
console.log("No label found. Please format PR title.")
}
github.rest.issues.addAssignees({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: [context.payload.pull_request.user.login]
})