mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add check for PRs with merge-blocking labels
This commit is contained in:
2
.github/workflows/on-open-handler.yml
vendored
2
.github/workflows/on-open-handler.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Label if Author is a Repo Maintainer
|
||||
# GitHub Script
|
||||
# https://github.com/marketplace/actions/github-script
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
// Get basic info
|
||||
|
44
.github/workflows/pr-auto-manager.yml
vendored
44
.github/workflows/pr-auto-manager.yml
vendored
@@ -73,9 +73,51 @@ jobs:
|
||||
with:
|
||||
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
|
||||
check-merge-blocking-labels:
|
||||
name: Check Merge Blocking Labels
|
||||
needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check Merge Blocking
|
||||
# GitHub Script
|
||||
# https://github.com/marketplace/actions/github-scriptLabels
|
||||
id: label-check
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const prLabels = context.payload.pull_request.labels.map(label => label.name);
|
||||
const blockingLabels = [
|
||||
"⛔ Don't Merge",
|
||||
"🔨 Needs Work",
|
||||
"🔬 Needs Testing",
|
||||
"⛔ Waiting For External/Upstream",
|
||||
"❗ Against Release Branch",
|
||||
"💥💣 Breaking Changes"
|
||||
];
|
||||
const hasBlockingLabel = prLabels.some(label => blockingLabels.includes(label));
|
||||
|
||||
if (hasBlockingLabel) {
|
||||
console.log("Blocking label detected. Setting warning status.");
|
||||
await github.rest.checks.create({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
name: "PR Label Warning",
|
||||
head_sha: context.payload.pull_request.head.sha,
|
||||
status: "completed",
|
||||
conclusion: "neutral",
|
||||
output: {
|
||||
title: "Potential Merge Issue",
|
||||
summary: "This PR has a merge-blocking label. Proceed with caution."
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log("No merge-blocking labels found.");
|
||||
}
|
||||
|
||||
pr-auto-comments:
|
||||
name: Post PR Comments Based on Labels
|
||||
needs: [check-merge-conflicts, pr-size-labeler]
|
||||
needs: [check-merge-conflicts, pr-size-labeler, label-release-prs, apply-file-based-labels]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
Reference in New Issue
Block a user