File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Label issues
2+ on :
3+ issues :
4+ types :
5+ - opened
6+ - reopened
7+ jobs :
8+ label_issues :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ issues : write
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v4
15+
16+ - name : Get issue details
17+ id : get_issue_details
18+ run : |
19+ ISSUE_BODY=$(gh issue view ${{ github.event.issue.number }} --json body -q .body)
20+ echo "::set-output name=body::$ISSUE_BODY"
21+ env :
22+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
23+
24+ - name : Determine labels
25+ id : determine_labels
26+ run : |
27+ CLEANED_BODY="${{ steps.get_issue_details.outputs.body }}"
28+ CLEANED_BODY=$(echo "$CLEANED_BODY" | sed 's/_No response_//g')
29+ CLEANED_BODY=$(echo "$CLEANED_BODY" | xargs)
30+ LABELS=""
31+
32+ if [[ "$CLEANED_BODY" == *"Core"* ]]; then
33+ LABELS="core"
34+ elif [[ "$CLEANED_BODY" == *"OneClient"* ]]; then
35+ LABELS="oneclient"
36+ elif [[ "$CLEANED_BODY" == *"OneLauncher"* ]]; then
37+ LABELS="onelauncher"
38+ fi
39+
40+ echo "LABELS=$LABELS" >> $GITHUB_ENV
41+
42+ - name : Add labels to issue
43+ run : |
44+ if [[ -n "${{ env.LABELS }}" ]]; then
45+ gh issue edit "${{ github.event.issue.number }}" --add-label "${{ env.LABELS }}"
46+ fi
47+ env :
48+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49+ GH_REPO : ${{ github.repository }}
50+
Original file line number Diff line number Diff line change 1010 runs-on : ubuntu-latest
1111 steps :
1212 - uses : actions/labeler@v6
13+ with :
14+ sync-labels : true
You can’t perform that action at this time.
0 commit comments