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 fc8dc48 commit c818766Copy full SHA for c818766
.github/workflows/block-PR-with-no-merge-label.yml
@@ -13,14 +13,7 @@ jobs:
13
uses: actions/github-script@v7
14
with:
15
script: |
16
- const labels = await github.rest.issues.listLabelsOnIssue({
17
- owner: context.repo.owner,
18
- repo: context.repo.repo,
19
- issue_number: context.issue.number
20
- });
21
-
22
- const hasNoMerge = labels.data.some(label => contains(label.name, 'NO-MERGE'));
23
24
- if (hasNoMerge) {
25
- core.setFailed('This pull request has a "NO-MERGE" label.');
26
- }
+ const labels = context.payload.pull_request.labels.map(label => label.name);
+ if (labels.includes("NO-MERGE")) {
+ core.setFailed("This pull request has a NO-MERGE label and cannot be merged.");
+ }
0 commit comments