Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(release): queue container publishes and pin release helpers (#1806)

Michael D'Angelo5ee36bc4c495
diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml
index eee1bdd57..408a59732 100644
--- a/.github/actionlint.yaml
+++ b/.github/actionlint.yaml
@@ -1,5 +1,5 @@
paths:
- .github/workflows/{node-github-release,node-release-cut,node-release}.yml:
+ .github/workflows/{container-release,node-github-release,node-release-cut,node-release}.yml:
ignore:
# actionlint 1.7.12 predates GitHub's queue: max support. Keep release queuing.
# https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency
diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml
index c2a7883ae..ca6bc9e41 100644
--- a/.github/workflows/container-release.yml
+++ b/.github/workflows/container-release.yml
@@ -16,7 +16,9 @@ on:
required: true
type: string
-concurrency: container-release-publish
+concurrency:
+ group: container-release-publish
+ queue: max
permissions:
contents: read
@@ -443,6 +445,7 @@ jobs:
timeout-minutes: 10
permissions:
attestations: write
+ artifact-metadata: write
contents: read
id-token: write
packages: write
diff --git a/.github/workflows/node-github-release.yml b/.github/workflows/node-github-release.yml
index 0aa8de4fe..136881af4 100644
--- a/.github/workflows/node-github-release.yml
+++ b/.github/workflows/node-github-release.yml
@@ -42,7 +42,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- ref: refs/heads/main
+ ref: ${{ github.sha }}
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
@@ -736,6 +736,7 @@ jobs:
contents: read
packages: write
attestations: write
+ artifact-metadata: write
id-token: write
uses: ./.github/workflows/container-release.yml
with:
diff --git a/sdk/typescript/tests-ts/container-release-workflow.test.ts b/sdk/typescript/tests-ts/container-release-workflow.test.ts
index 6601ebe98..dee5ed142 100644
--- a/sdk/typescript/tests-ts/container-release-workflow.test.ts
+++ b/sdk/typescript/tests-ts/container-release-workflow.test.ts
@@ -33,7 +33,13 @@ function workflow(name: string) {
new URL(`../../../.github/workflows/${name}.yml`, import.meta.url),
"utf8",
),
- ) as { jobs: Record<string, Job> };
+ ) as {
+ concurrency?: {
+ group: string;
+ queue?: string;
+ };
+ jobs: Record<string, Job>;
+ };
}
const release = workflow("container-release");
const directories: string[] = [];
@@ -178,6 +184,7 @@ test("coordinates publication, approval, and completion with the verified npm so
contents: "read",
packages: "write",
attestations: "write",
+ "artifact-metadata": "write",
"id-token": "write",
},
});
@@ -189,6 +196,13 @@ test("coordinates publication, approval, and completion with the verified npm so
});
expect(release.jobs["publish-platform"]?.needs).toBe("authorize");
expect(release.jobs["promote"]?.needs).toContain("attest");
+ expect(release.jobs["attest"]?.permissions?.["artifact-metadata"]).toBe(
+ "write",
+ );
+ expect(release.concurrency).toEqual({
+ group: "container-release-publish",
+ queue: "max",
+ });
});
test("builds and downloads native payloads from the same source as the image", () => {
diff --git a/sdk/typescript/tests-ts/release-automation.test.ts b/sdk/typescript/tests-ts/release-automation.test.ts
index 1a1c94a8c..a88ff3c10 100644
--- a/sdk/typescript/tests-ts/release-automation.test.ts
+++ b/sdk/typescript/tests-ts/release-automation.test.ts
@@ -2644,11 +2644,11 @@ describe("GitHub release workflow safeguards", () => {
);
});
- test("runs manually dispatched GitHub releases from trusted main", () => {
+ test("runs manually dispatched GitHub releases from the main commit selected for the run", () => {
expect(githubReleaseWorkflow).toContain("workflow_dispatch:");
expect(githubReleaseWorkflow).toContain("github.ref == 'refs/heads/main'");
expect(githubReleaseWorkflow).toMatch(
- /- name: Checkout release automation\n(?:[^\n]*\n)*?\s+ref: refs\/heads\/main/u,
+ /- name: Checkout release automation\n(?:[^\n]*\n)*?\s+ref: \$\{\{ github\.sha \}\}/u,
);
});