Skip to content

fix(release): strip refs/heads prefix from branch releases (#86) - #344

Open
harshitethic wants to merge 4 commits into
getsentry:masterfrom
harshitethic:fix/strip-head-ref-86-20261023
Open

harshitethic wants to merge 4 commits into
getsentry:masterfrom
harshitethic:fix/strip-head-ref-86-20261023

Conversation

@harshitethic

Copy link
Copy Markdown

What

Closes #86.

When release (or the deprecated version input) receives GitHub's ${{ github.ref }}, the action already strips refs/tags/ but leaves refs/heads/ intact. A release-candidate branch passed as refs/heads/release-candidate-1 then fails release-name validation.

Changes

  • Strip the refs/heads/ prefix in addition to refs/tags/ for explicit release inputs.
  • Preserve existing plain release values and leave unrelated ref namespaces unchanged.
  • Add parameterized regression tests for both release and version input variants.

Verification

  • yarn test --runInBand: 58 tests passed.
  • yarn lint: passed.
  • git diff --check: passed.

This intentionally does not rename slash-containing branch paths; it only removes the GitHub ref namespace as requested. AI-assisted patch, locally validated.

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0e74f57. Configure here.

Comment thread src/options.ts

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @harshitethic, thanks for the contribution.

You need to run the pre-commit hooks that will automatically build a new dist file and update the action's docker tag so it can be tested.

@harshitethic

Copy link
Copy Markdown
Author

Thanks for the review — I’ve addressed the generated-artifact requirements on this branch.

  • dist/index.js now includes the refs/heads/ prefix handling; rebuilding locally with yarn build produces no diff in the committed bundle.
  • action.yml uses the branch-specific Docker tag fix-strip-head-ref-86-20261023. Running yarn set-docker-tag-from-branch produces no diff.
  • Local verification: yarn format-check passed, yarn lint passed, yarn build passed, and yarn test --runInBand passed (58 tests).

The GitHub Actions workflows for this fork currently report action_required; maintainer approval may be needed before they can run. Happy to address anything those checks find.

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.

strip the prefix for github.ref (refs/heads)

2 participants