Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): clarify the default for tag_name #544

Merged
merged 1 commit into from
Dec 1, 2024

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
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