Repository navigation
ci: keep AZURE_OPENAI_API_KEY out of pull request runs - #323
Merged
Krishnadheeraj (DheerajPannala) merged 3 commits intoOct 27, 2026
Merged
Krishnadheeraj (DheerajPannala) merged 3 commits into
Krishnadheeraj (DheerajPannala) merged 3 commits into
Conversation
Run the integration-test step only on push. pull_request runs execute PR-authored Jest config and tests, so they must not receive repository secrets (CWE-522). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bde58a51-73ec-4b37-b60a-0b499ca60eb0
Krishnadheeraj (DheerajPannala)
requested a review
from a team
as a code owner
October 15, 2026 15:31
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Same-repository PRs can bypass the workflow condition, so secret access needs an independently enforced protection boundary.
1 open finding
What changed in this PR
Restricts secret-bearing integration tests to push runs while preserving other PR validation.
Changes:
- Adds a push-only condition to the integration-test step.
- Documents why unreviewed PR code should not receive repository secrets.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Gates integration tests on push events. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Do we want to disable integration tests for PRs? I feel like there should be another fix for this |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bde58a51-73ec-4b37-b60a-0b499ca60eb0
…ironment A step-level if: is not a boundary: pull_request runs use the PR's own workflow file, so an author could drop the condition. Move the integration tests into a push-only job that uses the integration-tests environment, so the key can live in an environment secret limited to main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bde58a51-73ec-4b37-b60a-0b499ca60eb0
Krishnadheeraj (DheerajPannala)
requested review from
dbezic (dbezic) and
Rick Brighenti (rbrighenti)
October 27, 2026 11:24
dbezic (dbezic)
approved these changes
Oct 27, 2026
Rick Brighenti (rbrighenti)
approved these changes
Oct 27, 2026
Krishnadheeraj (DheerajPannala)
deleted the
users/DheerajPannala/glasswing-ci-secret
branch
October 27, 2026 15:20
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.

Summary
The integration-test step in
.github/workflows/ci.ymlran in thepull_requestjob withAZURE_OPENAI_API_KEY. That step runsnpm run test:integration, which executes the Jest config and test files from the PR itself. So code that hadn't been reviewed yet could read the key (CWE-522).Change
Node.js SDKjob, which runs on every PR.Integration testsjob that:push(after merge)integration-testsenvironmentLint, unit tests, build and pack still run on every PR.
Why an environment
A
pull_requestrun uses the workflow file from the PR, so anif:condition alone can be edited away by the PR author. An environment secret is only released to jobs whose ref passes the environment's deployment rules. With the environment limited tomain, PR-authored workflows can't read the key, even if edited.Admin step after merge
Until this step is done, the job falls back to the existing repository secret, so CI keeps working.
integration-tests→ Deployment branches and tags → Selected branches → addmain.AZURE_OPENAI_API_KEY.AZURE_OPENAI_API_KEYsecret.