Skip to content

Commit c16b457

Browse files
authored
Merge pull request #8 from Azaya89/fix-auto_triage
Fix auto-triage label
2 parents e7a2c9c + 015975d commit c16b457

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/auto_triage.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,28 @@ jobs:
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 }}

0 commit comments

Comments
 (0)