Skip to content

Conversation

@alexeagle
Copy link
Contributor

The logic here:

? config.github_ref.replace("refs/tags/", "")

transforms github.ref in such a way that it matches github.ref_name instead.

Per docs:

github.ref_name string The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1.

Note, I could imagine a PR that changes the TypeScript code to use that variable instead, but I'm trying to be conservative here. Perhaps some users are on-prem GitHub Enterprise and that variable doesn't exist.

The logic here:
https://github.com/softprops/action-gh-release/blob/01570a1f39cb168c169c802c3bceb9e93fb10974/src/github.ts#L217

transforms `github.ref` in such a way that it matches `github.ref_name` instead. 

Per [docs](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context):

> github.ref_name	string	The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1.

Note, I could imagine a PR that changes the TypeScript code to use that variable instead, but I'm trying to be conservative here. Perhaps some users are on-prem GitHub Enterprise and that variable doesn't exist.
Copy link
Collaborator

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

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

nice catch, thanks!

@chenrui333 chenrui333 merged commit 39a5683 into softprops:master Dec 1, 2024
1 check passed
@chenrui333 chenrui333 added the bug Something isn't working label Dec 1, 2024
@alexeagle alexeagle deleted the patch-1 branch December 2, 2024 19:46
muzimuzhi added a commit to muzimuzhi/action-gh-release that referenced this pull request Mar 23, 2025
fix(docs): clarify the default for tag_name

Similar to softprops#544 but for input description in `action.yml`.
muzimuzhi added a commit to muzimuzhi/action-gh-release that referenced this pull request Mar 23, 2025
Similar to softprops#544 but for input description in `action.yml`.
chenrui333 pushed a commit that referenced this pull request Apr 10, 2025
Similar to #544 but for input description in `action.yml`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants