File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 66
77jobs :
88 do-not-merge :
9- if : ${{ contains(github.event.*.labels.*.name, 'DNM') }}
109 name : Prevent Merging
1110 runs-on : ubuntu-24.04
1211 steps :
13- - name : Check for label
12+ - name : Check for DNM label
13+ uses : actions/github-script@60a0d83039c725a5ff217e4aa4b5cc5170e1c8d7 # v7.0.1
14+ id : check-label
15+ with :
16+ script : |
17+ const labels = context.payload.pull_request.labels || [];
18+ const labelNames = labels.map(l => l.name);
19+ const hasDnm = labelNames.includes('DNM');
20+ core.setOutput('has_dnm', hasDnm);
21+ return hasDnm;
22+
23+ - name : Fail if DNM label exists
24+ if : steps.check-label.outputs.has_dnm == 'true'
1425 run : |
1526 echo "Pull request is labeled as 'DNM'"
1627 echo "This workflow fails so that the pull request cannot be merged"
You can’t perform that action at this time.
0 commit comments