We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25ff751 commit 97c6751Copy full SHA for 97c6751
.github/workflows/dnm.yml
@@ -6,11 +6,21 @@ on:
6
7
jobs:
8
do-not-merge:
9
- if: ${{ contains(github.event.*.labels.*.name, 'DNM') }}
10
name: Prevent Merging
11
runs-on: ubuntu-24.04
12
steps:
13
- - name: Check for label
+ - name: Check for DNM label
+ id: check-label
14
+ run: |
15
+ labels_json='${{ toJSON(github.event.pull_request.labels) }}'
16
+ if echo "$labels_json" | grep -q '"name":"DNM"'; then
17
+ echo "has_dnm=true" >> $GITHUB_OUTPUT
18
+ else
19
+ echo "has_dnm=false" >> $GITHUB_OUTPUT
20
+ fi
21
+
22
+ - name: Fail if DNM label exists
23
+ if: steps.check-label.outputs.has_dnm == 'true'
24
run: |
25
echo "Pull request is labeled as 'DNM'"
26
echo "This workflow fails so that the pull request cannot be merged"
0 commit comments