Skip to content

Commit

Permalink
Update patch if no workflows execution found
Browse files Browse the repository at this point in the history
  • Loading branch information
mzampetakis committed Apr 15, 2024
1 parent 0a9cc9a commit 20b5095
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type RequestPushEventMessage struct {
Pusher Pusher `json:"pusher"`
Before string `json:"before"`
After string `json:"after"`
Branch string `json:"branch"`
Commits []string `json:"commits"`
Repository Repository `json:"repository"`
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/github-actions-adapter/serve/comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func (gas *GitHubActionsServer) preparePatchCommentResultMessage(resultResponse
actionsStatus = "Status"
}
commentMessage := "### GitHub Actions " + actionsStatus + ": "
if len(resultResponse.ResultDetails) == 0 {
commentMessage += "No workflows found"
return commentMessage
}

if resultResponse.Response == app.BrokerResponseInProgress {
commentMessage += app.BrokerResponseInProgress
commentMessage += " ⏳"
Expand Down
2 changes: 1 addition & 1 deletion cmd/github-actions-adapter/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (gas *GitHubActionsServer) waitRepoCommitWorkflows(ctx context.Context,
}
}
if workflowsCompleted {
gas.App.Logger.Info("all workflows execution complete")
gas.App.Logger.Info("all workflows execution completed")
break
}
if brokerRequestMessage.PatchEvent != nil {
Expand Down

0 comments on commit 20b5095

Please sign in to comment.