Skip to content

Commit

Permalink
fix strconv.Atoi parsing error when no MR
Browse files Browse the repository at this point in the history
  • Loading branch information
daisuke-yokomoto committed May 6, 2022
1 parent dc87ae0 commit 8a08d68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/platform/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ func complementWithCIEnv(ci *config.CI) error {
ci.SHA = os.Getenv("CI_COMMIT_SHA")
}

if ci.MRNumber <= 0 {
mr := os.Getenv("CI_MERGE_REQUEST_IID")
if mr := os.Getenv("CI_MERGE_REQUEST_IID"); mr != "" && ci.MRNumber <= 0 {
a, err := strconv.Atoi(mr)
if err != nil {
return fmt.Errorf("parse CI_MERGE_REQUEST_IID %s: %w", mr, err)
Expand Down

0 comments on commit 8a08d68

Please sign in to comment.