Skip to content

Commit

Permalink
Merge pull request #6 from yokomotod/fix-none-mr
Browse files Browse the repository at this point in the history
fix strconv.Atoi parsing error when no MR
  • Loading branch information
hirosassa authored May 6, 2022
2 parents dc87ae0 + 8a08d68 commit d80c4b0
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 d80c4b0

Please sign in to comment.