File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Label New Issues
2
+
3
+ on :
4
+ issues :
5
+ types : [opened]
6
+
7
+ jobs :
8
+ label-issue :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - name : Checkout repository
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Add Label "status/need-triage" if no label starting with "severity" exists
16
+ env :
17
+ GITHUB_TOKEN : ${{ secrets.CHE_BOT_GITHUB_TOKEN }}
18
+ run : |
19
+ ISSUE_NUMBER=${{ github.event.issue.number }}
20
+ REPO=${{ github.repository }}
21
+ LABEL_TO_ADD="status/need-triage"
22
+ LABEL_PREFIX="severity"
23
+ # Get the issue labels
24
+ ISSUE_LABELS=$(gh issue view $ISSUE_NUMBER --json labels --jq '.labels[].name')
25
+ # Check if any label starts with 'severity'
26
+ if echo "$ISSUE_LABELS" | grep -q "^$LABEL_PREFIX"; then
27
+ echo "A label starting with '$LABEL_PREFIX' exists. No action needed."
28
+ else
29
+ echo "No label starting with '$LABEL_PREFIX' found. Adding '$LABEL_TO_ADD'."
30
+ # Add the label to the issue
31
+ gh issue edit $ISSUE_NUMBER --add-label "$LABEL_TO_ADD"
32
+ fi
You can’t perform that action at this time.
0 commit comments