Skip to content

Commit

Permalink
Report artifact: Do not fail artifact reporting in dry-run mode if co…
Browse files Browse the repository at this point in the history
…mmunication with kosli server fails
  • Loading branch information
ToreMerkely committed Nov 1, 2023
1 parent 2823175 commit edf9e55
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions cmd/kosli/reportArtifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,19 @@ func (o *reportArtifactOptions) run(args []string) error {
return err
}

previousCommit, err := o.latestCommit(currentBranch(gitView))
if err != nil {
return err
}

commitObject, err := gitView.GetCommitInfoFromCommitSHA(o.gitReference)
if err != nil {
return err
}

o.payload.GitCommit = commitObject.Sha1

o.payload.CommitsList, err = gitView.ChangeLog(o.payload.GitCommit, previousCommit, logger)
if err != nil {
previousCommit, err := o.latestCommit(currentBranch(gitView))
if err == nil {
o.payload.CommitsList, err = gitView.ChangeLog(o.payload.GitCommit, previousCommit, logger)
if err != nil && !global.DryRun {
return err
}
} else if !global.DryRun {
return err
}

Expand Down

0 comments on commit edf9e55

Please sign in to comment.