forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to prevent merging a PR when the
NO-MERGE
label is app…
…lied (dotnet#111940) * Add workflow to prevent merging a PR when the `NO-MERGE` label is applied. * Fix backtick bug in check-service-labels echo too.
- Loading branch information
1 parent
f71255e
commit 87e9f1d
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters