OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security
TypeScript ai-securityapplication-securityclicode-scanningcodexcodex-securitycybersecuritydevsecopsnodejsnpmopenaisdksecuritytypescriptvulnerability-scanning
ci: link failed source runs from PR edit checks (#1990)
Michael D'Angelo796fa130e927
diff --git a/.github/scripts/test-verify-pr-source.mjs b/.github/scripts/test-verify-pr-source.mjsindex 2cfa29f1e..b717bba35 100644--- a/.github/scripts/test-verify-pr-source.mjs+++ b/.github/scripts/test-verify-pr-source.mjs@@ -23,6 +23,7 @@ const passed = { status: "completed", conclusion: "success" };function run(id, changes = {}) {return {id,+ html_url: `https://github.com/example/repo/actions/runs/${id}`,run_number: id,run_attempt: 1,run_started_at: id,@@ -148,7 +149,7 @@ test("only fresh canonical source jobs and genuine selection can qualify a sourcassert.ok(!realSource({ ...page, ...change }, source));});-test("pending sources settle, genuine red remains red, and newer attempts cannot be masked", async () => {+test("pending sources settle, genuine red remains red, and newer attempts cannot be masked", async (t) => {const green = run(3),red = run(3, { conclusion: "failure" }),pending = run(3, { status: "in_progress" });@@ -163,10 +164,14 @@ test("pending sources settle, genuine red remains red, and newer attempts cannotawait fixture([[green, run(1, { run_attempt: 2 })]]).check(),"full",);+ const log = t.mock.method(console, "log", () => {});assert.equal(await fixture([[edit(8, { conclusion: "failure" }), red]]).check(),"failed",);+ assert.deepEqual(log.mock.calls[0]?.arguments, [+ `Failed source CI: ${red.html_url}/attempts/1`,+ ]);for (const changed of [[run(3, { run_attempt: 2 })],[run(5, { conclusion: "failure" }), green],diff --git a/.github/scripts/verify-pr-source.mjs b/.github/scripts/verify-pr-source.mjsindex 2622ad2d8..0e3652da0 100644--- a/.github/scripts/verify-pr-source.mjs+++ b/.github/scripts/verify-pr-source.mjs@@ -97,7 +97,10 @@ function sourceCandidate(runs, { pr, sha }) {return "full";if (runs.some((r) => r.status !== "completed")) return "pending";if (runs.every(successful)) return first;- if (runs.every((r) => r.conclusion === "failure")) return "failed";+ if (runs.every((r) => r.conclusion === "failure")) {+ console.log(`Failed source CI: ${first.html_url}/attempts/1`);+ return "failed";+ }return "full";}