Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch diggerhq/digger#1760 #1

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
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
20 changes: 9 additions & 11 deletions cli/pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,14 @@ func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCh
jobs = digger.SortedCommandsByDependency(jobs, &dependencyGraph)

allAppliesSuccessful, atLeastOneApply, err := digger.RunJobs(jobs, &githubPrService, &githubPrService, lock, reporter, planStorage, policyChecker, comment_updater.NoopCommentUpdater{}, backendApi, "", false, false, "0", currentDir)
if err != nil {
usage.ReportErrorAndExit(githubActor, fmt.Sprintf("Failed to run commands. %s", err), 8)
if !allAppliesSuccessful || err != nil {
// aggregate status checks: failure
if allAppliesSuccessful {
if atLeastOneApply {
githubPrService.SetStatus(prNumber, "failure", "digger/apply")
} else {
githubPrService.SetStatus(prNumber, "failure", "digger/plan")
}
if scheduler.IsPlanJobs(jobs) {
githubPrService.SetStatus(prNumber, "failure", "digger/plan")
} else {
githubPrService.SetStatus(prNumber, "failure", "digger/apply")
}
usage.ReportErrorAndExit(githubActor, fmt.Sprintf("Failed to run commands. %s", err), 8)
}

if diggerConfig.AutoMerge && allAppliesSuccessful && atLeastOneApply && coversAllImpactedProjects {
Expand All @@ -295,10 +293,10 @@ func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCh

if allAppliesSuccessful {
// aggreate status checks: success
if atLeastOneApply {
githubPrService.SetStatus(prNumber, "success", "digger/apply")
} else {
if scheduler.IsPlanJobs(jobs) {
githubPrService.SetStatus(prNumber, "success", "digger/plan")
} else {
githubPrService.SetStatus(prNumber, "success", "digger/apply")
}
}

Expand Down
Loading