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

Default value for release_branches unexpectedly matches substring #219

Open
remy-niles opened this issue Jul 30, 2024 · 0 comments
Open

Comments

@remy-niles
Copy link

I am willing to provide a simple pull request to fix the following issue, and am opening an issue to get some initial feedback.

The default values used for the release_branches parameter are matched as substrings by default instead of an exact string and so in some cases where the letters "main" or "master" appear in a branch name, a release tag will be generated. An example would be the word "maintenance" which contains the word "main".

This is the referenced parameter: https://github.com/mathieudutour/github-tag-action/blob/master/action.yml#L42-L45

The described behaviour is due to the fact that the String.match method used to match branch names matches for a substring by default: https://github.com/mathieudutour/github-tag-action/blob/master/src/action.ts#L55-L57

Although issues have a low chance of occurrence, it has occurred and has lead to wasted time troubleshooting.

Workaround and Solution
A workaround is possible by passing in the argument ^main$,^master$ when invoking the action, but we would prefer keeping as much default behaviour as possible.

The proposed solution is to change the default value of the parameter from "main,master" to "^main$,^master$".

Does this seem acceptable?

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

No branches or pull requests

1 participant