Skip to content

Improve Zappa/Terraform Migration #775

Improve Zappa/Terraform Migration

Improve Zappa/Terraform Migration #775

Workflow file for this run

name: Auto Label Issues
on:
issues:
types:
- edited
- opened
permissions:
issues: write
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Apply Labels to Issues
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
const issue = context.payload.issue;
if (!issue || (!issue.title && !issue.body)) return;
const title = issue.title?.toLowerCase() || "";
const body = issue.body?.toLowerCase() || "";
const keywordMapping = {
"bug": ["error", "failure", "not working", "crash", "unexpected"],
"enhancement": ["add", "feature request", "improve", "suggestion"],
"question": ["clarification", "help", "how to", "guidance"]
};
const labels = Object.entries(keywordMapping)
.filter(([_, words]) => words.some(word => title.includes(word) || body.includes(word)))
.map(([label, _]) => label);
if (labels.length > 0) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
labels: labels,
owner: context.repo.owner,
repo: context.repo.repo
});
}