File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 35
35
fi
36
36
env :
37
37
GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
38
+
39
+ prevent-label-removal :
40
+ runs-on : ubuntu-latest
41
+ steps :
42
+ - name : Prevent sl-require-admin-action label removal
43
+ if : github.event.action == 'unlabeled'
44
+ run : |
45
+ PR_NUMBER=${{ github.event.pull_request.number }}
46
+ REMOVED_LABEL=${{ github.event.label.name }}
47
+ if [ "$REMOVED_LABEL" == "sl-require-admin-action" ]; then
48
+ echo "The sl-require-admin-action label cannot be removed. Failing the job."
49
+ gh pr comment $PR_NUMBER --repo ${{ github.repository }} --body "The sl-require-admin-action label cannot be removed once it has been added."
50
+ exit 1
51
+ else
52
+ echo "A different label was removed. Passing the job."
53
+ fi
54
+ env :
55
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
You can’t perform that action at this time.
0 commit comments