feat(#1726): G1-G6 portability AST rules; fix all offenders; delete the ratchet (Phase 4) (#1731)

Phase 4 of epic #1702. Closes #1726.
This commit is contained in:
Tom Boucher
2026-06-25 18:24:39 -04:00
committed by GitHub
parent 2990305f78
commit f08b177215
88 changed files with 2038 additions and 377 deletions

View File

@@ -92,7 +92,7 @@ describe('security scan scripts exist and are executable', () => {
});
test(`${name} script has bash shebang`, () => {
const firstLine = fs.readFileSync(scriptPath, 'utf-8').split('\n')[0];
const firstLine = fs.readFileSync(scriptPath, 'utf-8').split(/\r?\n/)[0];
assert.ok(
firstLine.startsWith('#!/usr/bin/env bash') || firstLine.startsWith('#!/bin/bash'),
`${scriptPath} missing bash shebang: ${firstLine}`
@@ -563,7 +563,7 @@ describe('security-scan.yml workflow', () => {
test('workflow does not use direct github context in run commands', () => {
const content = fs.readFileSync(workflowPath, 'utf-8');
// Extract only run: blocks and check they don't contain ${{ }}
const runBlocks = content.match(/run:\s*\|?\s*\n([\s\S]*?)(?=\n\s*-|\n\s*\w+:|Z)/g) || [];
const runBlocks = content.match(/run:\s*\|?\s*\r?\n([\s\S]*?)(?=\r?\n\s*-|\r?\n\s*\w+:|Z)/g) || [];
for (const block of runBlocks) {
assert.ok(
!block.includes('${{'),