mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 14:38:13 -05:00
Fix public PR triage validation (#3531)
This commit is contained in:
14
.github/workflows/pull_request.yml
vendored
14
.github/workflows/pull_request.yml
vendored
@@ -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.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/pull_request_checks.yml
vendored
2
.github/workflows/pull_request_checks.yml
vendored
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user