Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions cmd/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type SummaryCmd struct {
JobKey string `help:"GitHub Actions job key (github.job)" name:"job-key"`
Mode string `help:"CargoWall mode (enforce/audit)"`
DefaultAction string `help:"Default action type (allow/deny)" name:"default-action"`
JobRunId uint64 `help:"GitHub Actions job run ID" name:"job-run-id"`
JobStatus string `help:"GitHub Actions job status (success/failure/canceled/cancelled/timed_out)" name:"job-status"`

output io.Writer // overridable for testing; defaults to os.Stdout
Expand Down Expand Up @@ -569,6 +570,10 @@ func (c *SummaryCmd) pushToApi(stepEvents []StepEvents, steps []GitHubStep) (str
Status: jobStatus,
}

if c.JobRunId != 0 {
req.JobRunId = &c.JobRunId
}

// Set timestamps from first/last events
if len(allEvents) > 0 {
req.StartedAt = timestamppb.New(allEvents[0].Timestamp)
Expand Down
53 changes: 33 additions & 20 deletions pb/cargowall/v1/cargo_wall_action.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions proto/v1/cargo_wall_action.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,17 @@ message CargoWallActionEvent {
}

message CreateCargoWallActionJobRequest {
string job_name = 1;
string job_key = 2;
CargoWallMode mode = 3;
CargoWallActionType default_action = 4;
CargoWallActionJobSummary summary = 5;
google.protobuf.Timestamp started_at = 6;
google.protobuf.Timestamp completed_at = 7;
CargoWallJobStatus status = 8;
// optional - will remove optional annotation in subsequent update
optional uint64 job_run_id = 1;
string job_name = 2;
string job_key = 3;
CargoWallMode mode = 4;
CargoWallActionType default_action = 5;
CargoWallActionJobSummary summary = 6;
google.protobuf.Timestamp started_at = 7;
google.protobuf.Timestamp completed_at = 8;
CargoWallJobStatus status = 9;


repeated CreateCargoWallActionStep steps = 100;
}
Expand Down
Loading