Skip to content

feature: add head sha to GitHub context - #28

Merged
tixxdz merged 2 commits into
mainfrom
pr/tixxdz/08-github-context-head-sha
Aug 31, 2026
Merged

tixxdz merged 2 commits into
mainfrom
pr/tixxdz/08-github-context-head-sha

Conversation

@tixxdz

@tixxdz tixxdz commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@tixxdz
tixxdz requested review from nicolasparada and a lite review from Copilot August 31, 2026 10:45
tixxdz added 2 commits August 31, 2026 11:47
Add optional head SHA field to the GitHub scenario type. This
field will be read from "github.event.pull_request.head.sha"

Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
@tixxdz
tixxdz force-pushed the pr/tixxdz/08-github-context-head-sha branch from d8cc224 to b52dbbe Compare August 31, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for capturing a pull request’s head commit SHA in the GitHub scenario context (head_sha), in addition to the existing merge/checkout SHA (sha). This extends the scenario payload to better represent PR executions where the merge commit and head commit differ.

Changes:

  • Added HeadSHA to ScenarioGitHub with JSON serialization support (head_sha, omitted when empty).
  • Updated ScenarioGitHub.Clone(), IsZero(), and MarshalJSONMap() to include/handle HeadSHA.
  • Extended unit tests and profile fixture data to cover HeadSHA cloning, marshaling, and round-trip behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/ongoing/types_test.go Updates the profile fixture to include the new HeadSHA field in the GitHub scenario.
pkg/ongoing/scenarios.go Introduces HeadSHA on ScenarioGitHub and wires it through clone/zero checks and JSON encoders.
pkg/ongoing/scenarios_test.go Adds test coverage for HeadSHA behavior (IsZero, MarshalJSON, round-trip, Clone, MarshalJSONMap).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings August 31, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@tixxdz
tixxdz merged commit 0bac0ee into main Aug 31, 2026
2 checks passed
@tixxdz
tixxdz deleted the pr/tixxdz/08-github-context-head-sha branch August 31, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants