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
Socket now gets its GitHub pull request details in one place. It reads the request number and the branch where the change will go. It also reads the commit ID. That ID points to the saved code that the change is based on.
If the job has no commit ID, Socket looks for it in the file GitHub sends with the job.
This gives #1772 a place to add GitLab and Azure. It also gives #1766 the details it needs to find the right scan to compare.
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.
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.
Summary
Socket now gets its GitHub pull request details in one place. It reads the request number and the branch where the change will go. It also reads the commit ID. That ID points to the saved code that the change is based on.
If the job has no commit ID, Socket looks for it in the file GitHub sends with the job.
This gives #1772 a place to add GitLab and Azure. It also gives #1766 the details it needs to find the right scan to compare.
Slides