Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/check-scoring-boundary.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import { execFileSync } from "node:child_process";
import { readFileSync, readdirSync, statSync } from "node:fs";
import { join, relative } from "node:path";
import { fileURLToPath } from "node:url";

const root = new URL("..", import.meta.url).pathname;
const root = fileURLToPath(new URL("..", import.meta.url));
const scoringDir = join(root, "scoring");
const errors = [];

Expand Down
1 change: 1 addition & 0 deletions scripts/feed-github-protection.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export async function captureState(request = githubRequest) {
}

export function validatePRChecks(workflow = readFileSync(resolve(prWorkflowPath), 'utf8')) {
workflow = workflow.replace(/\r\n/g, '\n');
assert(/^ pull_request:\s*$/m.test(workflow), 'CI must run PR merge compatibility checks');
assert(!/^ pull_request:\s*\n (paths|paths-ignore|branches|branches-ignore):/m.test(workflow), 'Required PR checks must run for every pull request (no path or branch filters)');
const jobs = workflow.slice(workflow.indexOf('\njobs:\n'));
Expand Down
2 changes: 1 addition & 1 deletion scripts/feed-github-protection.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { applyPlan, buildPlan, captureState, environmentTargets, hash, owner, repository, requiredPRJobs, rulesetId, validatePRChecks, verifyExisting, verifyExistingState } from './feed-github-protection.mjs';

const workflow = readFileSync('.github/workflows/scoring.yml', 'utf8');
const workflow = readFileSync('.github/workflows/scoring.yml', 'utf8').replace(/\r\n/g, '\n');
const clone = value => JSON.parse(JSON.stringify(value));
function server() {
const data = {
Expand Down