ci: switch release notes generation to Codex#177
Conversation
Greptile SummaryReplaces the Amp SDK–based release-note generation with the OpenAI Responses API (
Confidence Score: 4/5Safe to merge for the Codex/ChatGPT credential path; the The scripts/release-notes/generate.ts — the Important Files Changed
Sequence DiagramsequenceDiagram
participant GHA as GitHub Actions
participant 1P as 1Password
participant Script as generate.ts
participant OAI as OpenAI / Codex endpoint
participant GH as GitHub API
GHA->>1P: load OP_CODEX_SECRET_ITEM (continue-on-error)
1P-->>GHA: CODEX_ACCESS_TOKEN, CHATGPT_USERNAME, CODEX_ENDPOINT
GHA->>Script: run with env vars
Script->>GH: listTags / compareCommits / generateReleaseNotes
GH-->>Script: tags, commits, github notes
alt CODEX_ACCESS_TOKEN or OPENAI_API_KEY set
Script->>OAI: "responses.create(model, prompt) baseURL = CODEX_ENDPOINT or chatgpt.com/backend-api/codex"
OAI-->>Script: output_text
else no credential
Script->>Script: warn + use GitHub notes fallback
end
Script->>GHA: write RELEASE_NOTES.md
Reviews (4): Last reviewed commit: "ci: switch release notes generation to C..." | Re-trigger Greptile |
ae710c3 to
36b9d73
Compare
36b9d73 to
5c1c11c
Compare
| const codexAccessToken = process.env.CODEX_ACCESS_TOKEN || process.env.OPENAI_API_KEY; | ||
| if (codexAccessToken) { | ||
| try { | ||
| const { execute } = await import("@ampcode/sdk"); | ||
| for await (const message of execute({ prompt, options: { cwd: process.cwd() } })) { | ||
| if (message.type === "result") { | ||
| if (message.is_error) throw new Error(message.error ?? "Amp returned an error"); | ||
| notes = message.result ?? ""; | ||
| } | ||
| } | ||
| const response = await new OpenAI({ | ||
| apiKey: codexAccessToken, | ||
| baseURL: process.env.CODEX_ENDPOINT || "https://chatgpt.com/backend-api/codex", | ||
| defaultHeaders: process.env.CHATGPT_USERNAME ? { "ChatGPT-Account-ID": process.env.CHATGPT_USERNAME } : undefined, | ||
| }).responses.create({ | ||
| model: process.env.CODEX_MODEL || "gpt-5.5", | ||
| input: prompt, | ||
| }); | ||
| notes = response.output_text ?? ""; |
There was a problem hiding this comment.
OPENAI_API_KEY fallback always routes to the ChatGPT backend
When CODEX_ACCESS_TOKEN is absent but OPENAI_API_KEY is set, codexAccessToken is non-null so the if block runs — but CODEX_ENDPOINT is also unset, so baseURL falls back to "https://chatgpt.com/backend-api/codex". A standard OpenAI API key sent to the ChatGPT backend will return an authentication error every time. The PR description explicitly calls out OPENAI_API_KEY as the new credential path, so this is the primary onboarding story for contributors without a Codex account, and it will silently fall through to the GitHub-generated notes.
Summary
Validation