mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-04-26 15:28:26 +08:00
44 lines
1.2 KiB
YAML
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']
|
|
})
|
|
}
|