-
Notifications
You must be signed in to change notification settings - Fork 0
fix: require scoped Codex auto-resolve command #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
99dce51
fix: require scoped Codex auto-resolve command
BigSimmo 9dacfaa
Merge branch 'main' into codex/scoped-autoresolve-command
BigSimmo aa45064
fix: run prettier on check-codex-autofix-workflow.mjs to fix format c…
Copilot f7c9656
ci: pin hosted runner configuration
BigSimmo 5bd607f
Merge branch 'main' into codex/scoped-autoresolve-command
BigSimmo 65b541e
Merge branch 'main' into codex/scoped-autoresolve-command
BigSimmo ce6dc4c
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] b63fd1a
fix: format scripts/check-github-action-pins.mjs to pass Prettier check
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import { readdirSync, readFileSync } from "node:fs"; | ||
| import path from "node:path"; | ||
|
|
||
| const workflowDir = path.join(process.cwd(), ".github", "workflows"); | ||
|
|
||
| const supportedMajorRanges = new Map([ | ||
| [ | ||
| "actions/checkout", | ||
| { | ||
| min: 4, | ||
| max: 6, | ||
| reason: | ||
| "v6 is the currently supported and documented major that this repo has vetted; upgrading to v7 should be a deliberate, reviewed decision.", | ||
| }, | ||
| ], | ||
| [ | ||
| "peter-evans/create-or-update-comment", | ||
| { | ||
| min: 5, | ||
| max: 5, | ||
| reason: "create-or-update-comment v6 is not a documented published major for this workflow.", | ||
| }, | ||
| ], | ||
| ]); | ||
|
|
||
| const usesPattern = /^\s*uses:\s*([^@\s]+)@v(\d+)\s*(?:#.*)?$/; | ||
| const runsOnLatestPattern = /^\s*runs-on:\s*ubuntu-latest\s*(?:#.*)?$/; | ||
| const failures = []; | ||
|
|
||
| for (const fileName of readdirSync(workflowDir) | ||
| .filter((name) => /\.ya?ml$/i.test(name)) | ||
| .sort()) { | ||
| const filePath = path.join(workflowDir, fileName); | ||
| const lines = readFileSync(filePath, "utf8").split(/\r?\n/); | ||
|
|
||
| lines.forEach((line, index) => { | ||
| if (runsOnLatestPattern.test(line)) { | ||
| failures.push( | ||
| `${fileName}:${index + 1}: runs-on uses ubuntu-latest. Pin GitHub-hosted Linux jobs to ubuntu-24.04 so CI is not tied to the moving ubuntu-latest alias.`, | ||
| ); | ||
| } | ||
|
|
||
| const match = line.match(usesPattern); | ||
| if (!match) return; | ||
|
|
||
| const [, action, rawMajor] = match; | ||
| const range = supportedMajorRanges.get(action); | ||
| if (!range) return; | ||
|
|
||
| const major = Number(rawMajor); | ||
| if (!Number.isInteger(major) || major < range.min || major > range.max) { | ||
| failures.push( | ||
| `${fileName}:${index + 1}: ${action}@v${rawMajor} is outside supported range v${range.min}-v${range.max}. ${range.reason}`, | ||
| ); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| if (failures.length > 0) { | ||
| console.error("GitHub Actions pin check failed:"); | ||
| for (const failure of failures) console.error(`- ${failure}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| console.log("GitHub Actions pin check passed."); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.