forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.23 KB
/
issue-labeled.yml
File metadata and controls
41 lines (37 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: CC0-1.0
#
# Issue lifecycle: Remove "Waiting for: Triage" label when "Waiting for:" label is added
name: 'Issues: Remove previous waiting labels'
on:
issues:
types: [labeled]
permissions:
issues: write
jobs:
cleanup-labels:
runs-on: ubuntu-24.04
if: |
! github.event.issue.pull_request &&
contains(github.event.label.name, 'Waiting for:')
steps:
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const labels = await github.rest.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
for (const label of labels.data) {
if (label.name.startsWith('Waiting for: ') && label.name != context.payload.label.name) {
console.log(`Removing label ${label.name}`);
await github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
})
}
}