Skip to content

Commit c818766

Browse files
committed
update
1 parent fc8dc48 commit c818766

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

.github/workflows/block-PR-with-no-merge-label.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ jobs:
1313
uses: actions/github-script@v7
1414
with:
1515
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-
}
16+
const labels = context.payload.pull_request.labels.map(label => label.name);
17+
if (labels.includes("NO-MERGE")) {
18+
core.setFailed("This pull request has a NO-MERGE label and cannot be merged.");
19+
}

0 commit comments

Comments
 (0)