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

Use releaseBranch variable instead of the hard-coded "main" in git log command #190

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

mmizutani
Copy link
Contributor

This PR replaces a hard-coded main branch name, "main", with the releaseBranch variable in a git command in tagpr.go.

With the original implementation, when a release branch name different from "main" (e.g., "master" or "develop") is specified in the .tagpr config file, we encounter the following error during the execution of the Songmu/tagpr@v1 action:

...
Switched to a new branch 'tagpr-from-v1.24.0'
git [add -f .tagpr]
git [commit --allow-empty -am [tagpr] prepare for the next release]
[tagpr-from-v1.24.0 b505e8d25] [tagpr] prepare for the next release

git [log --no-merges --pretty=format:%h %s main..origin/tagpr-from-v1.24.0]
fatal: ambiguous argument 'main..origin/tagpr-from-v1.24.0': unknown revision or path not in the working tree.  👈
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Such a git log ... command error is currently ignored and results in an empty diff ("What's Changed" section) in the automated pull request as follows:
image

This PR corrects the git log command so that tagpr successfully retrieves non-merge commits even when the name of the release branch is anything other than "main".

@mmizutani mmizutani marked this pull request as ready for review January 7, 2025 06:33
@Songmu Songmu merged commit c2444fc into Songmu:main Jan 7, 2025
@Songmu
Copy link
Owner

Songmu commented Jan 7, 2025

oops...
Thank you!

@mmizutani
Copy link
Contributor Author

mmizutani commented Jan 7, 2025

@Songmu
Thank you for the new version release. 😃
Nice tool!

@mmizutani mmizutani deleted the fix/hard-coded-main-branch branch January 7, 2025 10:23
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.

2 participants