fix: expand merge commit SHA regex and add SHA-256 test cases#2414
Open
yaananth wants to merge 3 commits intoactions:mainfrom
Open
fix: expand merge commit SHA regex and add SHA-256 test cases#2414yaananth wants to merge 3 commits intoactions:mainfrom
yaananth wants to merge 3 commits intoactions:mainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
salmanmkc
reviewed
Apr 15, 2026
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>
Contributor
There was a problem hiding this comment.
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-helperto treat 64-hex refs as explicit SHAs (setcommit, clearref). - Update
ref-helpermerge 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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
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