Tooltip Collision for Contributors Across Multiple Projects #44
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
| name: "Auto Label Issues" | |
| on: | |
| issues: | |
| types: | |
| - edited | |
| - opened | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Apply Labels to Issues | |
| uses: actions/[email protected] | |
| with: | |
| script: | | |
| const issue = context.payload.issue; | |
| const keywords = { | |
| "bug": ["error", "failure", "not working"], | |
| "enhancement": ["add", "feature request", "improve"], | |
| "question": ["clarification", "help", "how to"] | |
| }; | |
| let labels = []; | |
| for (const [label, words] of Object.entries(keywords)) { | |
| if (words.some(word => issue.title.toLowerCase().includes(word) || issue.body.toLowerCase().includes(word))) { | |
| labels.push(label); | |
| } | |
| } | |
| if (labels.length > 0) { | |
| github.rest.issues.addLabels({ | |
| issue_number: context.issue.number, | |
| labels: labels, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo | |
| }); | |
| } |