Repository navigation
FREEBOX plugin can generate false Disconnected/Flapping state when L3 reachability temporarily drops #352
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: 🏷 Label Issues by Installation Type | |
| on: | |
| issues: | |
| types: [opened] | |
| permissions: | |
| issues: write | |
| jobs: | |
| add-label: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get issue content | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const body = (context.payload.issue.body || "").toLowerCase(); | |
| // --- Check for template marker --- | |
| const hasTemplate = body.includes('netalertx_template'); | |
| if (!hasTemplate) { | |
| console.log("No template marker found, skipping labeling."); | |
| return; // skip labeling | |
| } | |
| // --- Proceed with normal labeling --- | |
| let labelsToAdd = []; | |
| if (body.includes('bare-metal') || body.includes('proxmox')) { | |
| labelsToAdd.push('bare-metal ❗'); | |
| } | |
| if (body.includes('home assistant')) { | |
| labelsToAdd.push('Home Assistant 🏠'); | |
| } | |
| if (body.includes('production (netalertx)') || body.includes('dev (netalertx-dev)')) { | |
| labelsToAdd.push('Docker 🐋'); | |
| } | |
| if (labelsToAdd.length > 0) { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| labels: labelsToAdd | |
| }); | |
| console.log(`Added labels: ${labelsToAdd.join(", ")}`); | |
| } |