2022-10-15 19:47:39 +02:00
|
|
|
name: issue needs triage
|
|
|
|
|
|
|
|
on:
|
|
|
|
issues:
|
|
|
|
types: [opened]
|
|
|
|
|
|
|
|
jobs:
|
2022-12-24 00:31:02 +02:00
|
|
|
issue-needs-triage:
|
2022-10-15 19:47:39 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/github-script@v6
|
|
|
|
with:
|
2022-12-24 00:31:02 +02:00
|
|
|
github-token: ${{secrets.GH_PAT}}
|
2022-10-15 19:47:39 +02:00
|
|
|
script: |
|
|
|
|
const labels = await github.paginate(
|
|
|
|
github.rest.issues.listLabelsOnIssue, {
|
|
|
|
issue_number: context.issue.number,
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
if (labels.length === 0) {
|
|
|
|
github.rest.issues.addLabels({
|
|
|
|
issue_number: context.issue.number,
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
labels: ['needs triage']
|
|
|
|
})
|
|
|
|
}
|