Skip to content

Commit 25d08f2

Browse files
re-add label when it is removed to prevent any bypass scenario
1 parent 5af0872 commit 25d08f2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/silabs-require-admin-action-check.yaml

+14-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
'sl-require-admin-action') }}
2525
steps:
2626
- name: Add comment to PR
27-
uses: actions/github-script@v6
27+
uses: actions/github-script@v7
2828
with:
2929
script: |
3030
const prNumber = context.payload.pull_request.number;
@@ -59,7 +59,7 @@ jobs:
5959
'sl-require-admin-action'
6060
steps:
6161
- name: Add comment to PR
62-
uses: actions/github-script@v6
62+
uses: actions/github-script@v7
6363
with:
6464
script: |
6565
const prNumber = context.payload.pull_request.number;
@@ -79,6 +79,18 @@ jobs:
7979
});
8080
}
8181
82+
- name: Re-add sl-require-admin-action label
83+
uses: actions/github-script@v7
84+
with:
85+
script: |
86+
const prNumber = context.payload.pull_request.number;
87+
await github.rest.issues.addLabels({
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
issue_number: prNumber,
91+
labels: ['sl-require-admin-action'],
92+
});
93+
8294
- name: Prevent sl-require-admin-action label removal
8395
run: |
8496
echo "The sl-require-admin-action label cannot be removed. Failing the job."

0 commit comments

Comments
 (0)