Skip to content

fix: expand merge commit SHA regex and add SHA-256 test cases#2414

Open
yaananth wants to merge 3 commits intoactions:mainfrom
yaananth:sha256/p2-ref-helper-and-tests
Open

fix: expand merge commit SHA regex and add SHA-256 test cases#2414
yaananth wants to merge 3 commits intoactions:mainfrom
yaananth:sha256/p2-ref-helper-and-tests

Conversation

@yaananth
Copy link
Copy Markdown

@yaananth yaananth commented Apr 14, 2026

Fixes https://github.com/github/actions-runtime/issues/5476
Fixes https://github.com/github/actions-runtime/issues/5481
Fixes https://github.com/github/actions-runtime/issues/5482

Summary

  • expand merge commit SHA parsing in ref-helper to accept 40- and 64-character SHAs
  • add SHA-256 coverage in input-helper and ref-helper tests
  • include the coupled input-helper SHA regex update required for the new test coverage

Automated by project-board-agents-plugin via /project-board-agents:lead
Board: https://github.com/orgs/github/projects/24272/views/1
Items: [P2] Fix merge commit SHA regex + [P2] Add SHA-256 test cases
Run: sha256-p2-checkout-00050

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/ref-helper.ts Outdated
yaananth and others added 2 commits April 16, 2026 15:27
Add checkCommitInfo tests for SHA-1 and SHA-256 merge messages and reject invalid 50-character hex merge heads.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yaananth yaananth marked this pull request as ready for review April 28, 2026 17:37
Copilot AI review requested due to automatic review settings April 28, 2026 17:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Expands SHA parsing to support repositories using SHA-256 (64-hex) commit IDs, and adds test coverage to ensure SHA-256 refs and merge commit messages are handled correctly.

Changes:

  • Update input-helper to treat 64-hex refs as explicit SHAs (set commit, clear ref).
  • Update ref-helper merge commit message parsing to accept both 40- and 64-hex SHAs.
  • Add Jest coverage for SHA-256 inputs and SHA-256 merge commit message parsing (including a negative case).
Show a summary per file
File Description
src/ref-helper.ts Expands merge commit message SHA regex to accept 40- or 64-char hex SHAs.
src/input-helper.ts Expands explicit-SHA detection to accept 40- or 64-char hex SHAs.
dist/index.js Updates bundled output to reflect the new SHA regex behavior.
test/ref-helper.test.ts Adds SHA-256 checkout info test and new checkCommitInfo SHA-1/SHA-256/invalid-merge coverage.
test/input-helper.test.ts Adds SHA-256 explicit SHA input test ensuring ref is cleared and commit is set.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/5 changed files
  • Comments generated: 0

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