Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
fix: skip reporting runs created via API (#622)
Browse files Browse the repository at this point in the history
Fixes #618
  • Loading branch information
leg100 committed Oct 19, 2023
1 parent 8a9b1f9 commit 5d4527b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/run/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func (r *Reporter) Start(ctx context.Context) error {
}

func (r *Reporter) handleRun(ctx context.Context, run *Run) error {
// Skip runs triggered via the UI
if run.Source == SourceUI {
// Skip runs triggered via the UI or API
if run.Source == SourceUI || run.Source == SourceAPI {
return nil
}

Expand Down
5 changes: 5 additions & 0 deletions internal/run/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func TestReporter_HandleRun(t *testing.T) {
run: &Run{ID: "run-123", Source: SourceUI},
want: vcs.SetStatusOptions{},
},
{
name: "skip API-triggered run",
run: &Run{ID: "run-123", Source: SourceAPI},
want: vcs.SetStatusOptions{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 5d4527b

Please sign in to comment.