Skip to content

Commit

Permalink
Merge pull request #26 from tensor4all/terasaki/fix-pkgbump
Browse files Browse the repository at this point in the history
Refer the default branch
  • Loading branch information
terasakisatoshi authored Nov 16, 2024
2 parents 4aa72c0 + c481ff2 commit 05c49ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PkgBump/PkgBump.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function bump(mode::Symbol; commit::Bool = true, push::Bool = true)::Nothing
error("""You are working on "$(current_branch)".
Please checkout on the default branch i.e., "main" or "master".
""")
defaultbranch = deepcopy(current_branch)

if commit
!LibGit2.isdirty(repo) ||
Expand Down Expand Up @@ -58,8 +59,7 @@ function bump(mode::Symbol; commit::Bool = true, push::Bool = true)::Nothing
@info "Push to origin..."
run(`git -C $(project_dir) push --set-upstream origin $branch`)
@info "Hint: you can create a new pull request to GitHub repository via GitHub CLI:"
basebranch = readchomp(`git -C . rev-parse --abbrev-ref HEAD`) # e.g., main or master
@info "gh pr create --base $(basebranch) --head $(branch) --title \"Bump version to $(new_version)\" --body \"This PR updates version to $(new_version)\""
@info "gh pr create --base $(defaultbranch) --head $(branch) --title \"Bump version to $(new_version)\" --body \"This PR updates version to $(new_version)\""
@info "Hint: you can merge the pull request via GitHub CLI:"
@info "gh pr merge $(branch) --merge --auto --delete-branch"
else
Expand Down

0 comments on commit 05c49ea

Please sign in to comment.