From ff4e6ea1ca498d389680236afad7a76a88024a07 Mon Sep 17 00:00:00 2001 From: Greg Furman Date: Sat, 27 Apr 2024 12:22:18 +0200 Subject: [PATCH] Fix incorrect passing of GitHub workflow run ID; Make svc errors not mention git provider --- internal/checker/service.go | 2 +- internal/gateway/github_client.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/checker/service.go b/internal/checker/service.go index 0bbad88..62926cd 100644 --- a/internal/checker/service.go +++ b/internal/checker/service.go @@ -55,7 +55,7 @@ func (s *Service) GetPipeline() (*gateway.Pipeline, error) { func (s *Service) GetPipelineStatusByID(id string, pid int) (string, error) { pipeline, err := s.gatewayClient.GetPipeline(id, pid) if err != nil { - return "", fmt.Errorf("failed to get project from GitLab: %w", err) + return "", fmt.Errorf("failed to get project: %w", err) } return pipeline.Status, nil diff --git a/internal/gateway/github_client.go b/internal/gateway/github_client.go index aade3a5..ea94a75 100644 --- a/internal/gateway/github_client.go +++ b/internal/gateway/github_client.go @@ -3,7 +3,6 @@ package gateway import ( "context" "fmt" - "strconv" "strings" "github.com/google/go-github/v61/github" @@ -78,8 +77,8 @@ func workflowToPipeline(wf *github.WorkflowRun) *Pipeline { return &Pipeline{ Status: status, - ID: int(wf.GetWorkflowID()), - ProjectID: strconv.FormatInt(wf.GetID(), 10), + ID: int(wf.GetID()), + ProjectID: wf.GetRepository().GetFullName(), URL: wf.GetHTMLURL(), CommitSha: wf.GetHeadCommit().GetSHA(), }