Add check for PRs with merge-blocking labels

843bd1cf3cbc7b74246e244b5a99dd845a1729cd

Wolfsblvt <wolfsblvt@gmail.com>

2 files changed, +44 -2Showing whitespace changes
.github/workflows/on-open-handler.yml+1 -1
@@ -15,7 +15,7 @@ jobs:
15 - name: Label if Author is a Repo Maintainer15 - name: Label if Author is a Repo Maintainer
16 # GitHub Script16 # GitHub Script
17 # https://github.com/marketplace/actions/github-script17 # https://github.com/marketplace/actions/github-script
18 uses: actions/github-script@v618 uses: actions/github-script@v7
19 with:19 with:
20 script: |20 script: |
21 // Get basic info21 // Get basic info
.github/workflows/pr-auto-manager.yml+43 -1
@@ -73,9 +73,51 @@ jobs:
73 with:73 with:
74 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}74 repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
7575
76 check-merge-blocking-labels:
77 name: Check Merge Blocking Labels
78 needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels]
79 runs-on: ubuntu-latest
80
81 steps:
82 - name: Check Merge Blocking
83 # GitHub Script
84 # https://github.com/marketplace/actions/github-scriptLabels
85 id: label-check
86 uses: actions/github-script@v7
87 with:
88 script: |
89 const prLabels = context.payload.pull_request.labels.map(label => label.name);
90 const blockingLabels = [
91 "⛔ Don't Merge",
92 "🔨 Needs Work",
93 "🔬 Needs Testing",
94 "⛔ Waiting For External/Upstream",
95 "❗ Against Release Branch",
96 "💥💣 Breaking Changes"
97 ];
98 const hasBlockingLabel = prLabels.some(label => blockingLabels.includes(label));
99
100 if (hasBlockingLabel) {
101 console.log("Blocking label detected. Setting warning status.");
102 await github.rest.checks.create({
103 owner: context.repo.owner,
104 repo: context.repo.repo,
105 name: "PR Label Warning",
106 head_sha: context.payload.pull_request.head.sha,
107 status: "completed",
108 conclusion: "neutral",
109 output: {
110 title: "Potential Merge Issue",
111 summary: "This PR has a merge-blocking label. Proceed with caution."
112 }
113 });
114 } else {
115 console.log("No merge-blocking labels found.");
116 }
117
76 pr-auto-comments:118 pr-auto-comments:
77 name: Post PR Comments Based on Labels119 name: Post PR Comments Based on Labels
78 needs: [check-merge-conflicts, pr-size-labeler]120 needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels]
79 runs-on: ubuntu-latest121 runs-on: ubuntu-latest
80122
81 steps:123 steps: