fix(security): restrict live CI credentials to protected main - #2405
Merged
Conversation
HAYDEN-OAI
marked this pull request as ready for review
August 18, 2026 21:59
Contributor
jbeckwith-oai
approved these changes
Aug 18, 2026
jbeckwith-oai
left a comment
Contributor
There was a problem hiding this comment.
Independent two-pass review confirms this change materially reduces existing API-key exposure: pull requests, forks, feature branches, and merge groups run credential-free CI while protected-main live tests retain coverage. Critical documented rollout prerequisite: an administrator must restrict the ci environment to the selected main branch; it currently has no environment branch policy, so branch-editable workflow conditions alone cannot establish the promised hard boundary. This environment weakness predates the PR and is not a newly introduced code defect. Approving the improvement with that operational requirement explicitly noted.
Draft
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes being requested
cienvironment andOPENAI_API_KEYto non-Dependabotpushevents on the exact protectedopenai/openai-nodemainbranch.ecosystem testsjob without an environment, secret, or--liveflag for ordinary pull requests, forks, feature-branch pushes, and merge groups.Required administrator follow-up after merge
Configure the existing
cienvironment's Deployment branches and tags to Selected branches and tags, allowing onlymain. Do not allow pull-request refs, merge-queue refs,alpha, or other branches. Apply this only after the updated workflow lands onmain.This repository setting is not changed by the PR. It is required for complete enforcement because workflow-level guards cannot stop a separately defined branch workflow from referencing an environment that remains unrestricted.
Validation
mainand passes with this workflow.CI=1 ./node_modules/.bin/vitest run --config vitest.config.mts --no-cache tests/ecosystem-cli.test.ts— 17 passed../scripts/lint— passed across 656 files../node_modules/.bin/tsc --ignoreConfig --noEmit --strict --skipLibCheck --target ES2020 --module NodeNext --moduleResolution NodeNext --types jest,node tests/ecosystem-cli.test.ts— passed.git diff --check— passed./proc-dependent Cloudflare fixtures. Current-main GitHub CI is green; PR CI will provide the authoritative complete run.