Skip to content

Commit

Permalink
Update triagelabel.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jollylili authored Sep 27, 2024
1 parent e1e3325 commit 35d06bc
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/triagelabel.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
name: Label issues
name: Add Triage Label

on:
issues:
types:
- reopened
- opened
types: [opened]

jobs:
label_issues:
triage:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- run: gh issue edit "$NUMBER" --add-label "triage"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
- name: Check for existing labels
id: check_labels
uses: actions/github-script@v6
with:
script: |
const labels = await github.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
return labels.data.length > 0;
- name: Add Triage Label
if: steps.check_labels.outputs.result == 'false'
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: triage

0 comments on commit 35d06bc

Please sign in to comment.