Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions dependency_updater/dependency_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func main() {
Action: func(ctx context.Context, cmd *cli.Command) error {
err := updater(string(cmd.String("token")), string(cmd.String("repo")), cmd.Bool("commit"), cmd.Bool("github-action"))
if err != nil {
return fmt.Errorf("error running updater: %s", err)
return fmt.Errorf("running updater: %s", err)
}
return nil
},
Expand Down Expand Up @@ -153,7 +153,7 @@ func createCommitMessage(updatedDependencies []VersionUpdateInfo, repoPath strin
} else if !githubAction {
cmd := exec.Command("git", "commit", "-am", commitTitle, "-m", commitDescription)
if err := cmd.Run(); err != nil {
return fmt.Errorf("error running git commit -m: %s", err)
return fmt.Errorf("running git commit -m: %s", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason for removing the error in front? ex. here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes it a bit unclear and sounds like "running git commit -m" is currently being run

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, yeah, that's my mistake. Sorry for that

makes it a bit unclear and sounds like "running git commit -m" is currently being run

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np! other changes are fine

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just
return fmt.Errorf("failed to run git commit -m: %s", err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed sir

}
}
return nil
Expand Down Expand Up @@ -293,9 +293,8 @@ func updateVersionTagAndCommit(
func writeToVersionsJson(repoPath string, dependencies Dependencies) error {
// formatting json
updatedJson, err := json.MarshalIndent(dependencies, "", " ")
print(dependencies["base_reth_node"].Branch)
if err != nil {
return fmt.Errorf("error Marshaling dependencies json: %s", err)
return fmt.Errorf("error marshaling dependencies json: %s", err)
}

e := os.WriteFile(repoPath+"/versions.json", updatedJson, 0644)
Expand Down Expand Up @@ -344,20 +343,20 @@ func createGitMessageEnv(title string, description string, repoPath string) erro
file := os.Getenv("GITHUB_OUTPUT")
f, err := os.OpenFile(file, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
return fmt.Errorf("error failed to open GITHUB_OUTPUT file: %s", err)
return fmt.Errorf("failed to open GITHUB_OUTPUT file: %s", err)
}
defer f.Close()

titleToWrite := fmt.Sprintf("%s=%s\n", "TITLE", title)
_, err = f.WriteString(titleToWrite)
if err != nil {
return fmt.Errorf("error failed to write to GITHUB_OUTPUT file: %s", err)
return fmt.Errorf("failed to write to GITHUB_OUTPUT file: %s", err)
}

descToWrite := fmt.Sprintf("%s=%s\n", "DESC", description)
_, err = f.WriteString(descToWrite)
if err != nil {
return fmt.Errorf("error failed to write to GITHUB_OUTPUT file: %s", err)
return fmt.Errorf("failed to write to GITHUB_OUTPUT file: %s", err)
}

return nil
Expand Down