Skip to content

Commit f107e24

Browse files
authored
chore: workflow to clean pr after merging (#2239)
1 parent 0aef50c commit f107e24

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/pr-cleanup.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PR Cleanup
2+
on:
3+
pull_request:
4+
types: [closed]
5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
jobs:
9+
cleanup:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Remove awaiting review label
13+
uses: actions/github-script@v9
14+
with:
15+
script: |
16+
const labels = context.payload.pull_request.labels.map((label) => label.name);
17+
if (labels.includes("awaiting review")) {
18+
await github.rest.issues.removeLabel({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
issue_number: context.payload.pull_request.number,
22+
name: "awaiting review",
23+
});
24+
}

0 commit comments

Comments
 (0)