Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0-staging] Add workflow to prevent merging a PR when the NO-MERGE label is applied #111961

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/check-no-merge-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: check-no-merge-label

permissions:
pull-requests: read

on:
pull_request:
types: [opened, edited, reopened, labeled, unlabeled, synchronize]
branches:
- 'main'
- 'release/**'

jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- name: Check 'NO-MERGE' label
run: |
echo "Merging permission is disabled when the 'NO-MERGE' label is applied."
if [ "${{ contains(github.event.pull_request.labels.*.name, 'NO-MERGE') }}" = "false" ]; then
exit 0
else
echo "::error:: The 'NO-MERGE' label was applied to the PR. Merging is disabled."
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/check-service-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Check 'Servicing-approved' label
run: |
echo "Merging permission is enabled for servicing PRs when the `Servicing-approved` label is applied."
echo "Merging permission is enabled for servicing PRs when the 'Servicing-approved' label is applied."
if [ "${{ contains(github.event.pull_request.labels.*.name, 'Servicing-approved') }}" = "true" ]; then
exit 0
else
Expand Down
Loading