-
-
Notifications
You must be signed in to change notification settings - Fork 11
30 lines (30 loc) · 1.2 KB
/
autolabeler.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Auto Labeler
on:
issues:
types: [opened, edited]
jobs:
autolabeler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: stefanbuck/github-issue-parser@2d2ff50d4aae06ab58d26bf59468d98086605f11 # v3
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/1-report-issue.yml
- name: "Trim services list using only shell variable internal (no subshell to avoid injection!)"
env:
SERVICES: ${{ steps.issue-parser.outputs.issueparser_services }}
run: echo "svc_labels=${SERVICES// /}" >> "$GITHUB_ENV"
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2
with:
app_id: ${{ secrets.JENKINS_INFRA_HELPDESK_APP_ID }}
private_key: ${{ secrets.JENKINS_INFRA_HELPDESK_APP_PRIVATE_KEY }}
- run: gh issue edit "$NUMBER" --add-label "$LABELS" --remove-label "$RM_LABELS"
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: ${{ env.svc_labels }}
RM_LABELS: "other"