Fix public PR triage validation (#3531)

This commit is contained in:
Lorenz Junglas
2025-12-02 13:50:20 +01:00
committed by GitHub
parent 84bc10a6c4
commit 003381b674
2 changed files with 4 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ jobs:
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
const requiredChecks = ['Tests', 'Formatting']; const requiredChecks = ['format', 'tests'];
const pr = context.payload.pull_request; const pr = context.payload.pull_request;
if (!pr) { if (!pr) {
@@ -33,16 +33,8 @@ jobs:
if (!match || match.conclusion !== 'success') { if (!match || match.conclusion !== 'success') {
const status = match ? (match.conclusion ?? match.status ?? 'unknown') : 'missing'; const status = match ? (match.conclusion ?? match.status ?? 'unknown') : 'missing';
core.warning(`Required check '${requiredCheck}' did not pass (${status}). Removing triaged label.`); core.warning(`Required check '${requiredCheck}' did not pass (${status}).`);
throw new Error('Cannot triage until required checks succeed. Remove and re-add the triaged label to retry.');
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
name: 'triaged'
});
throw new Error('Cannot triage until required checks succeed.');
} }
} }

View File

@@ -8,7 +8,7 @@ permissions:
contents: read contents: read
jobs: jobs:
format: tests:
runs-on: [ windows-latest ] runs-on: [ windows-latest ]
steps: steps:
- name: Full Checkout - name: Full Checkout