File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed
Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: slo-report
22
33on :
44 workflow_run :
5- workflows : ["slo "]
5+ workflows : ["SLO "]
66 types :
77 - completed
88
2121 with :
2222 github_token : ${{ secrets.GITHUB_TOKEN }}
2323 github_run_id : ${{ github.event.workflow_run.id }}
24+ remove-slo-label :
25+ needs : test-ydb-slo-action
26+ if : always() && github.event.workflow_run.event == 'pull_request'
27+ runs-on : ubuntu-latest
28+ name : Remove SLO Label
29+ permissions :
30+ pull-requests : write
31+ steps :
32+ - name : Remove SLO label from PR
33+ uses : actions/github-script@v7
34+ with :
35+ script : |
36+ const pullRequests = context.payload.workflow_run.pull_requests;
37+ if (pullRequests && pullRequests.length > 0) {
38+ for (const pr of pullRequests) {
39+ try {
40+ await github.rest.issues.removeLabel({
41+ owner: context.repo.owner,
42+ repo: context.repo.repo,
43+ issue_number: pr.number,
44+ name: 'SLO'
45+ });
46+ console.log(`Removed SLO label from PR #${pr.number}`);
47+ } catch (error) {
48+ if (error.status === 404) {
49+ console.log(`SLO label not found on PR #${pr.number}, skipping`);
50+ } else {
51+ throw error;
52+ }
53+ }
54+ }
55+ } else {
56+ console.log('No pull requests associated with this workflow run');
57+ }
You can’t perform that action at this time.
0 commit comments