Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
Merge pull request #7 from ipfs/catch-all
Browse files Browse the repository at this point in the history
Address issues raised in #3
  • Loading branch information
galargh authored Jun 30, 2023
2 parents c4c7919 + 0e8ea14 commit a252d3b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions actions/prepare_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (ctx PrepareBranch) UpdateVersion(branch, source, currentVersionNumber, bas
}

func (ctx PrepareBranch) Run() error {
log.Info("I'm going to create a PRs that update the version in the release branch and the master branch.")
log.Info("I'm going to create PRs that update the version in the release branch and the master branch.")
log.Info("I'm also going to update the changelog if we're performing the final release. Please note that it might take a while because I have to clone a looooot of repos.")

dev := fmt.Sprintf("%s.0-dev", ctx.Version.NextMajorMinor())
Expand Down Expand Up @@ -227,6 +227,7 @@ Please approve after all the required commits are cherry-picked.`, branch, repos
return err
}

fmt.Println("Use merge commit to merge this PR! You'll have to tag it after the merge.")
if !util.ConfirmPR(pr) {
return fmt.Errorf("%s not merged", pr.GetHTMLURL())
}
Expand All @@ -245,7 +246,7 @@ Please approve after all the required commits are cherry-picked.`, branch, repos
if err != nil {
return err
}
if !util.ConfirmPR(pr) {
if !pr.GetMerged() && !util.ConfirmPR(pr) {
return fmt.Errorf("%s not merged", pr.GetHTMLURL())
}
}
Expand Down
2 changes: 1 addition & 1 deletion actions/update_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (ctx UpdateInterop) Run() error {
branch := repos.Interop.KuboBranch(ctx.Version)
title := fmt.Sprintf("Update Kubo: %s", ctx.Version)
body := fmt.Sprintf("This PR updates Kubo to %s", ctx.Version)
command := util.Command{Name: "npm", Args: []string{"install", fmt.Sprintf("go-ipfs@%s", ctx.Version), "--save-dev"}}
command := util.Command{Name: "npm", Args: []string{"install", fmt.Sprintf("go-ipfs@%s", ctx.Version), "--save-dev", "--save-exact"}}

b, err := ctx.GitHub.GetOrCreateBranch(repos.Interop.Owner, repos.Interop.Repo, branch, repos.Interop.DefaultBranch)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion actions/update_ipfs_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (ctx UpdateIPFSDesktop) Run() error {
branch := repos.IPFSDesktop.KuboBranch(ctx.Version)
title := fmt.Sprintf("Update Kubo: %s", ctx.Version)
body := fmt.Sprintf("This PR updates Kubo to %s", ctx.Version)
command := util.Command{Name: "npm", Args: []string{"install", fmt.Sprintf("go-ipfs@%s", ctx.Version), "--save"}}
command := util.Command{Name: "npm", Args: []string{"install", fmt.Sprintf("go-ipfs@%s", ctx.Version), "--save", "--save-exact"}}

b, err := ctx.GitHub.GetOrCreateBranch(repos.IPFSDesktop.Owner, repos.IPFSDesktop.Repo, branch, repos.IPFSDesktop.DefaultBranch)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ func (c *Client) GetOrCreatePR(owner, repo, head, base, title, body string, draf
if err != nil {
return nil, err
}
if pr != nil && pr.GetMerged() {
return pr, nil
}
if pr == nil || pr.GetState() == "closed" {
pr, err = c.CreatePR(owner, repo, head, base, title, body, draft)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion util/confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Enter a value: `, prompt)
}

func ConfirmPR(pr *github.PullRequest) bool {
prompt := fmt.Sprintf(`Go to %s, ensure the CI checks pass, and merge the PR. Use merge commit if possible.
prompt := fmt.Sprintf(`Go to %s, ensure the CI checks pass, and merge the PR.
Please approve once the PR is merged.`, pr.GetHTMLURL())
return Confirm(prompt)
Expand Down

0 comments on commit a252d3b

Please sign in to comment.