You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CI scan setup needs one consistent source for pull-request identity and baseline metadata. This extracts GitHub PR number, base branch, and base commit SHA detection into a shared context used by socket ci, including the event-payload fallback for the base SHA.
Low Risk
Refactor of CI env parsing with equivalent PR-number behavior for scans; new async file read only runs on GitHub PR workflows when base SHA env is absent.
Overview
Introduces detectCiPullRequestContext as the single place to read GitHub Actions PR metadata: PR number from GITHUB_REF, optional base branch (GITHUB_BASE_REF), and base commit SHA (GITHUB_BASE_SHA, with a fallback that parses GITHUB_EVENT_PATH when the SHA env var is missing).
handle-ci drops the inlined detectCiPullRequestNumber helper and awaits the new detector; behavior for scan creation is unchanged today because only number is still passed through as pullRequest. The expanded fields are positioned for follow-up PRs that will consume baseline metadata.
Tests now target the full CiPullRequestContext shape and restore all relevant GitHub env vars between cases. .gitignore is updated to track the new module.
John-David Dalton (jdalton)
changed the title
refactor(ci): centralize pull request context
feat(python-cli-parity): centralize pull request context
Nov 25, 2026
This branch has not been deployed
No deployments
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
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.
CI scan setup needs one consistent source for pull-request identity and baseline metadata. This extracts GitHub PR number, base branch, and base commit SHA detection into a shared context used by
socket ci, including the event-payload fallback for the base SHA.Stacked follow-ups: SocketDev/socket-cli#1772 and SocketDev/socket-cli#1766.