Skip to content

Commit

Permalink
Merge pull request #25 from tensor4all/terasaki/fix-pkgbump-info
Browse files Browse the repository at this point in the history
get default branch
  • Loading branch information
terasakisatoshi authored Oct 30, 2024
2 parents 2be76c1 + 43dd391 commit 94cec47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/T4ARegistrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function register(package::Union{Module,Nothing} = nothing)
current_branch in ["main", "master"] || error("""You are working on "$(current_branch)".
Please checkout on the default branch i.e., "main" or "master".
""")
defaultbranch = deepcopy(current_branch)

d = Dict()
local pkg
Expand Down Expand Up @@ -71,14 +72,13 @@ function register(package::Union{Module,Nothing} = nothing)
end

@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

pr_title = "$(LocalRegistry.commit_title(pkg, new_package))"

tree_hash, _, _ = LocalRegistry.get_tree_hash(package_dir, gitconfig)

pr_body = "UUID: $(pkg.uuid)\nRepo: $(package_repo)\nTree: $(string(tree_hash))"
command = "gh pr create --repo tensor4all/T4ARegistry --base $(basebranch) --head $(branch) --title \"$(pr_title)\" --body \"$(pr_body)\""
command = "gh pr create --repo tensor4all/T4ARegistry --base $(defaultbranch) --head $(branch) --title \"$(pr_title)\" --body \"$(pr_body)\""
println(command)
@info "Hint: you can merge the pull request via GitHub CLI:"
println("gh pr merge --repo tensor4all/T4ARegistry $(branch) --merge --auto --delete-branch")
Expand Down

0 comments on commit 94cec47

Please sign in to comment.