forked from webex/widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove-validated-on-synchronize.yml
More file actions
41 lines (35 loc) · 1.23 KB
/
Copy pathremove-validated-on-synchronize.yml
File metadata and controls
41 lines (35 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
name: Remove Validated Label On New Push
run-name: Remove validated label for PR #${{ github.event.pull_request.number }}
on:
pull_request_target:
types: [synchronize]
permissions:
pull-requests: write
jobs:
remove-validated-label:
name: Remove reusable validated label
runs-on: ubuntu-latest
steps:
- name: Remove validated label from PR
uses: actions/github-script@v8
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const pull_number = context.payload.pull_request.number;
const labels = context.payload.pull_request.labels.map((label) => label.name);
if (!labels.includes('validated')) {
core.info('No validated label found; skipping.');
return;
}
try {
await github.rest.issues.removeLabel({
owner,
repo,
issue_number: pull_number,
name: 'validated',
});
core.info('Removed validated label after synchronize event.');
} catch (error) {
core.warning(`Failed to remove validated label: ${error.message}`);
}