File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 1111 permissions :
1212 issues : write
1313 steps :
14- - run : gh issue edit "$NUMBER" --add-label "$LABELS"
14+ - name : Check if issue needs triage
15+ id : check-labels
16+ run : |
17+ # Get current labels - if any exist, the issue has been looked at
18+ label_count=$(gh issue view "$NUMBER" --json labels --jq '.labels | length')
19+ echo "Number of existing labels: $label_count"
20+
21+ if [ "$label_count" -eq 0 ]; then
22+ needs_triage=true
23+ else
24+ needs_triage=false
25+ fi
26+
27+ echo "needs_triage=$needs_triage" >> $GITHUB_OUTPUT
28+ env :
29+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30+ GH_REPO : ${{ github.repository }}
31+ NUMBER : ${{ github.event.issue.number }}
32+
33+ - name : Add triage label
34+ if : steps.check-labels.outputs.needs_triage == 'true'
35+ run : gh issue edit "$NUMBER" --add-label "$LABELS"
1536 env :
1637 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1738 GH_REPO : ${{ github.repository }}
You can’t perform that action at this time.
0 commit comments