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
refactor(release): remove retired GitHub publication commands (#2226)
Michael D'Angelo8710f546be6b
diff --git a/sdk/typescript/scripts/release-automation.mjs b/sdk/typescript/scripts/release-automation.mjsindex 0c2785979..97fbcaebd 100644--- a/sdk/typescript/scripts/release-automation.mjs+++ b/sdk/typescript/scripts/release-automation.mjs@@ -1,6 +1,5 @@import { X509Certificate, hash } from "node:crypto";import { readFileSync } from "node:fs";-import { basename } from "node:path";import { isMain } from "./is-main.mjs";import { assertExpectedGitHead } from "./package-provenance.mjs";@@ -148,24 +147,6 @@ export function composeReleaseNotes(generatedNotes, releaseSummary) {].join("\n");}-function releaseNoteFileArguments(args) {- const files = {};- for (let index = 0; index < args.length; index += 2) {- const option = args[index];- const file = args[index + 1];- if (- file === undefined ||- (option !== "--tagged-notes-file" &&- option !== "--existing-notes-file") ||- files[option] !== undefined- ) {- throw new Error("Invalid release note file arguments.");- }- files[option] = file;- }- return files;-}-/*** @param {string} refType* @param {string} ref@@ -934,29 +915,6 @@ function main() {return;}- if (command === "compose-release-notes" && process.argv.length >= 5) {- const version = process.argv[3];- const generatedNotes = readFileSync(process.argv[4], "utf8");- const normalizedGeneratedNotes = generatedNotes.replace(/(?:\r?\n)+$/u, "");- if (normalizedGeneratedNotes.length === 0) {- throw new Error("Generated GitHub release notes must not be empty.");- }- const files = releaseNoteFileArguments(process.argv.slice(5));- const taggedNotes =- files["--tagged-notes-file"] === undefined- ? undefined- : readFileSync(files["--tagged-notes-file"], "utf8");- const existingNotes =- files["--existing-notes-file"] === undefined- ? undefined- : readFileSync(files["--existing-notes-file"], "utf8");- const summary = resolveReleaseSummary(version, taggedNotes, existingNotes);- process.stdout.write(- composeReleaseNotes(normalizedGeneratedNotes, summary),- );- return;- }-if (command === "release-history" && process.argv.length === 4) {const registryVersions = JSON.parse(process.env.CODEX_SECURITY_PUBLISHED_NPM_VERSIONS ?? "[]",@@ -1016,24 +974,6 @@ function main() {return;}- if (- command === "verify-github-release" &&- (process.argv.length === 5 || process.argv.length === 6)- ) {- const release = JSON.parse(readFileSync(0, "utf8"));- const archivePath = process.argv[3];- const archive = readFileSync(archivePath);- const verified = verifyGitHubRelease(- release,- archive,- process.argv[4],- basename(archivePath),- process.argv[5] === undefined ? undefined : readFileSync(process.argv[5]),- );- console.log(JSON.stringify(verified));- return;- }-throw new Error("Usage: release-automation.mjs version <package.json>, " +"release-tag <ref-type> <ref> <ref-name> <package.json>, " +@@ -1044,9 +984,6 @@ function main() {"(published npm versions JSON from stdin), " +"release-mode <version> (published npm versions JSON from stdin), " +"validate-release-notes <version> <release-notes-file>, " +- "compose-release-notes <version> <generated-notes-file> " +- "[--tagged-notes-file <file>] " +- "[--existing-notes-file <file>], " +"release-history <tag>, " +"verify-publication <archive> <version> <git-head> " +"(package metadata JSON from stdin), " +@@ -1054,11 +991,9 @@ function main() {"<repository> <run-id> (package metadata JSON from stdin and " +"verified provenance from CODEX_SECURITY_VERIFIED_PROVENANCE), " +"verify-provenance <archive> <version> <git-head> <repository> <run-id> " +- "(signature audit JSON from stdin), " ++ "(signature audit JSON from stdin), or " +"verify-recovered-provenance <archive> <version> <git-head> " +- "<repository> (signature audit JSON from stdin), or " +- "verify-github-release <archive> <tag> [downloaded-asset] " +- "(GitHub release JSON from stdin).",+ "<repository> (signature audit JSON from stdin).",);}diff --git a/sdk/typescript/tests-ts/release-automation.test.ts b/sdk/typescript/tests-ts/release-automation.test.tsindex 338c18246..07fdc92d1 100644--- a/sdk/typescript/tests-ts/release-automation.test.ts+++ b/sdk/typescript/tests-ts/release-automation.test.ts@@ -702,31 +702,6 @@ describe("reviewed release note helpers", () => {}});- test("rejects NUL bytes before shell composition", async () => {- const workspace = directories.create("release-notes-nul-");- const taggedNotes = join(workspace, "tagged-notes.md");- const generatedNotes = join(workspace, "generated-notes.md");- writeFileSync(taggedNotes, "<!-- release-version: 1.2.3 -->\n\0\n");- writeFileSync(generatedNotes, "Generated release notes\n");-- const result = await runShell(- [- "set -euo pipefail",- 'published_notes="$(node "$AUTOMATION_SCRIPT" compose-release-notes 1.2.3 "$GENERATED_NOTES" --tagged-notes-file "$TAGGED_NOTES")"',- 'printf "%s" "$published_notes"',- ].join("\n"),- {- AUTOMATION_SCRIPT: fileURLToPath(automationScript),- GENERATED_NOTES: generatedNotes,- TAGGED_NOTES: taggedNotes,- },- );-- expect(result.status).toBe(1);- expect(result.stderr).toContain("include a reviewed summary");- expect(result.stderr).not.toContain("ignored null byte");- });-test.each([{name: "canonical prefix marker pair",@@ -3613,6 +3588,14 @@ ${workflowStepShell(releaseCutWorkflow, "Resolve the stable package version")}latestUpdated: false,status: 1,},+ {+ description: "NUL-bearing tagged summary",+ releaseSummary: "<!-- release-version: 0.1.2 -->\nReviewed\0summary",+ expectedError: "include a reviewed summary",+ updated: false,+ latestUpdated: false,+ status: 1,+ },{description: "generated notes without its tagged reviewed summary",releaseSummary:@@ -3860,38 +3843,6 @@ ${workflowStepShell(releaseCutWorkflow, "Resolve the stable package version")}expect(githubReleaseWorkflow).not.toContain("CODEX_SECURITY_SUMMARY_START");});- test.each([false, true])(- "composes notes with optional files: %p",- async (optional) => {- const workspace = mkdtempSync(join(tmpdir(), "release notes "));- const generated = join(workspace, "generated notes.md");- const tagged = join(workspace, "tagged notes.md");- const existing = join(workspace, "existing notes.md");- try {- writeFileSync(generated, "Generated notes\n");- writeFileSync(- tagged,- "<!-- release-version: 0.1.2 -->\nReviewed summary",- );- writeFileSync(existing, "Old generated notes");- const result = await runCommand("node", [- fileURLToPath(automationScript),- "compose-release-notes",- "0.1.2",- generated,- ...(optional- ? ["--tagged-notes-file", tagged, "--existing-notes-file", existing]- : []),- ]);- expect(result.status).toBe(0);- expect(result.stdout).toContain("Generated notes");- expect(result.stdout.includes("Reviewed summary")).toBe(optional);- } finally {- rmSync(workspace, { recursive: true, force: true });- }- },- );-test("cryptographically verifies the exact npm provenance bundle", () => {expect(githubReleaseWorkflow).toContain('node-version: "24.15.0"');expect(githubReleaseWorkflow).toContain("npm audit signatures");@@ -4343,7 +4294,6 @@ PATH="$RUNNER_TEMP:$PATH" verify`,expect(result.stderr).toContain("published npm versions JSON from stdin");expect(result.stderr).toContain("package metadata JSON from stdin");expect(result.stderr).toContain("signature audit JSON from stdin");- expect(result.stderr).toContain("GitHub release JSON from stdin");});});