Repository navigation
fix(security): publish main builds only from pushes to main, and lift oauthlib to 4.0.1 - #6993
Conversation
… oauthlib to 4.0.1 The release workflow_run branches filter matches the head branch name, which a fork PR opened from its own main shares. Require the CI run to be a push to this repository and the commit to be on main before building or publishing the rolling main build. Floor oauthlib at 4.0.1 for GHSA-3jp2-3mrg-2vxc (via kubernetes), and drop the neon client's unused logger (CodeQL py/unused-global-variable).
Greptile code reviewThis repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md. Run a review — add a PR comment with: Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5. Optional: automate with the greploop skill. |
|
🚀 Houston, we have a merge. VaibhavUpreti your PR is in orbit. Thanks for launching this one! 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |
[High impact] The PR changes which commits can feed the automatic rolling release and updates a dependency used by the application. The PR appears safe to merge, with a non-blocking gap in tests for the release guards. Findings
SummaryThis PR narrows automatic rolling releases to successful CI pushes from the same repository and checks that the source commit belongs to
|
| prepare_if = yaml.load(workflow, Loader=yaml.BaseLoader)["jobs"]["prepare"]["if"] | ||
| assert "github.event.workflow_run.event == 'push'" in prepare_if | ||
| assert "github.event.workflow_run.head_repository.full_name == github.repository" in prepare_if | ||
| assert 'git merge-base --is-ancestor "$source_sha" refs/remotes/origin/main' in workflow |
There was a problem hiding this comment.
Disabled guards still pass tests
The new assertions check only that guard text exists. They still pass if prepare.if gains || true, or if the ancestor check stops exiting on failure. A later edit could disable either release guard while these tests stay green.
Add cases that check the result for a fork PR, a same-repository push, and commits both on and outside main, using the actual workflow expression and shell block.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fixes https://github.com/Tracer-Cloud/opensre/security/dependabot/60
Describe the changes you have made in this PR -
release.yml): theworkflow_runtrigger'sbranches: [main]filter matches the CI run's head branch name. A fork PR opened from the fork's ownmainhas that same name, and CI runs on fork PRs (automatically for returning contributors), with the PR's own copy ofci.yml. If such a run reachedprepare, Release would build the fork's commit and publish it as the rollingmain-buildrelease usingMAIN_BUILD_TAG_TOKEN. That release is the build the installer's main channel and the hosted gateway image take.preparenow also requiresworkflow_run.event == 'push'andhead_repository == github.repository, and the metadata step refuses aworkflow_runcommit that is not onorigin/main.workflow_runruns against 473 CI pushes to main, and none came from the 11 fork-mainCI runs (one of which succeeded on 2026-11-05). The guard stops relying on that platform behaviour.kubernetes→requests-oauthlib), floored in[tool.uv].constraint-dependencies.integrations/neon/client.py: drop the unusedlogger, which clears the open CodeQLpy/unused-global-variablealert.Demo/Screenshot for feature changes and bug fixes -
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
The job-level
ifstops a fork-triggered run before any step executes (so no fork code is checked out or run), and the ancestor check is a second, trigger-independent guard that aworkflow_runrelease only ever ships a commit on main.test_release_workflow_does_not_run_on_pull_requestsnow asserts both.workflow_dispatchandscheduleare unchanged.Checklist before requesting a review