Skip to content

Commit

Permalink
Don't add success messages to failure commit statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
drakon64 committed Nov 18, 2024
1 parent 234114c commit 596929c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Amaurot.Processor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,17 @@ await gitHubClient.CreateIssueComment(
taskRequestBody.InstallationId
);

var commitStatus =
executionState == CommitStatusState.Success
? "All OpenTofu plans passing"
: "Some OpenTofu plans failed";

await gitHubClient.CreateCommitStatus(
repositoryFullName,
taskRequestBody.Sha,
executionState.ToString().ToLower(), // TODO: https://github.com/dotnet/runtime/issues/92828
taskRequestBody.InstallationId,
"All OpenTofu plans passing"
commitStatus
);

return Results.Ok();
Expand Down

0 comments on commit 596929c

Please sign in to comment.