mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
44 lines
1.1 KiB
YAML
Executable File
44 lines
1.1 KiB
YAML
Executable File
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;
|
|
|
|
const lowerBody = body.toLowerCase();
|
|
|
|
let labelsToAdd = [];
|
|
|
|
if (lowerBody.includes('bare-metal')) {
|
|
labelsToAdd.push('bare-metal ❗');
|
|
}
|
|
|
|
if (lowerBody.includes('home assistant')) {
|
|
labelsToAdd.push('Home Assistant 🏠');
|
|
}
|
|
|
|
if (lowerBody.includes('production (netalertx)') || lowerBody.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
|
|
});
|
|
}
|