pr-semver-bump icon indicating copy to clipboard operation
pr-semver-bump copied to clipboard

Bump fails when run on the very first commit in a repository

Open siggimoo opened this issue 3 years ago • 3 comments

If a new repository is based on a template containing a workflow with this action, it may end up being run on the very first commit. However, since that commit is not based on a PR it causes the action to fail. It would be nice if it could instead emit a default version number or at least have the option of doing so. Perhaps it could be configurable: some option that does nothing if unset or emits the specified value if run on the first commit.

siggimoo avatar Jan 01 '22 03:01 siggimoo

The intended behavior of the action is to ignore anything that doesn't look like a pull request merger. Can you provide an example of the error(s) you're seeing in the scenario you described?

jefflinse avatar Feb 09 '22 05:02 jefflinse

I suppose as a general rule it's understandable that no version is assigned without a PR since it would be impossible to know whether it should be a major, minor, or patch bump. However, the original problem still stands: new repositories created from templates that include this action fail on their initial commits when they otherwise would succeed. Perhaps the appropriate behavior under these conditions would be a no-op.

siggimoo avatar Feb 09 '22 17:02 siggimoo

Thanks for linking to an example. This is likely a bug then. The action should effectively be a no-op when not running in the context of a merged pull request.

I will investigate and resolve this over the weekend.

jefflinse avatar Feb 11 '22 03:02 jefflinse