weblate/.github/workflows/issue-opened.yml
renovate[bot] 4a05524be0
chore(deps): update actions/github-script action to v9 (#18890)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-10 02:53:16 +00:00

44 lines
1.2 KiB
YAML

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: CC0-1.0
#
# Issue lifecycle: Add "Waiting for: Triage" label when creating an issue
name: 'Issues: Add triage label to new issues'
on:
issues:
types: [opened]
permissions:
issues: write
jobs:
apply-label:
if: |
! github.event.issue.pull_request
runs-on: ubuntu-slim
steps:
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const labels = await github.rest.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
var should_label = true;
for (const label of labels.data) {
if (label.name.startsWith('Waiting for: ')) {
should_label = false;
}
}
if (should_label) {
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Waiting for: Triage']
})
}