Feature: Add ZT3 support to SHUT #127
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: Issue Labeler for Dropdown | |
| on: | |
| issues: | |
| types: [opened] | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issueBody = context.payload.issue.body; | |
| const shfwLabel = 'shfw'; | |
| const shutLabel = 'shut'; | |
| const criticalLabel = 'critical'; | |
| const highLabel = 'high'; | |
| const mediumLabel = 'medium'; | |
| const lowLabel = 'low'; | |
| let labelsToAdd = []; | |
| if (issueBody.includes('Firmware (SHFW)')) { | |
| labelsToAdd.push(shfwLabel); | |
| } | |
| if (issueBody.includes('Utility (SHUT)')) { | |
| labelsToAdd.push(shutLabel); | |
| } | |
| if (issueBody.includes('low (asthetic, minor issue)')) { | |
| labelsToAdd.push(lowLabel); | |
| } | |
| if (issueBody.includes('medium (affects usability but has a workaround)')) { | |
| labelsToAdd.push(mediumLabel); | |
| } | |
| if (issueBody.includes('high (major functionality broken, no workaround)')) { | |
| labelsToAdd.push(highLabel); | |
| } | |
| if (issueBody.includes('critical (app crash, data loss)')) { | |
| labelsToAdd.push(criticalLabel); | |
| } | |
| if (issueBody.includes('low (take your time)')) { | |
| labelsToAdd.push(lowLabel); | |
| } | |
| if (issueBody.includes('medium (upcoming releases)')) { | |
| labelsToAdd.push(mediumLabel); | |
| } | |
| if (issueBody.includes('high (definitely next release)')) { | |
| labelsToAdd.push(highLabel); | |
| } | |
| if (labelsToAdd.length > 0) { | |
| github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| labels: labelsToAdd | |
| }); | |
| } |