Only strip refs/heads/ prefix from branch name when present - #254
Merged
Conversation
GITHUB_REF_NAME is already the short ref name, so unconditionally slicing off "refs/heads/".length characters chopped real characters off the branch name instead. That silently mislabeled short branch names (e.g. "mayhem" -> "" -> falls back to "main") and could crash the mayhem CLI's argument parser for longer names where the slice left a leading "-" (e.g. "delta-repro-buggy-mhh-run-11" -> "-buggy-mhh-run-11", read as a flag).
Mayhem Automated Code Testing Report❗ 1 Defects Found
Testing details found at https://app.mayhem.security/forallsecure/mcode-action/mayhemit/47 |
sauliusbc
marked this pull request as ready for review
September 4, 2026 14:16
ethan42
approved these changes
Sep 4, 2026
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.
GITHUB_REF_NAME is already the short ref name, so unconditionally slicing off
"refs/heads/".lengthcharacters chopped real characters off the branch name instead. For short names this silently fell back to"main"; for longer names it could leave a leading-, which crashed the mayhem CLI's argument parser (e.g.delta-repro-buggy-mhh-run-11->-buggy-mhh-run-11).Extracted
resolveBranchName(), which checks for the prefix before stripping it.