Skip to content

Commit

Permalink
feat: send pr number when getting ignores from cloud (#1349)
Browse files Browse the repository at this point in the history
  • Loading branch information
gotbadger authored Oct 24, 2023
1 parent fb77ead commit c0fa3d5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions api/fetch_ignores.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"encoding/json"
"os"

ignoretypes "github.com/bearer/bearer/internal/util/ignore/types"
)
Expand All @@ -14,18 +15,21 @@ type CloudIgnoreData struct {
}

type CloudIgnorePayload struct {
Project string `json:"project"`
LocalIgnores []string `json:"local_ignores"`
Project string `json:"project"`
LocalIgnores []string `json:"local_ignores"`
PullRequestNumber string `json:"pull_request_number,omitempty"`
}

func (api *API) FetchIgnores(fullname string, localIgnores []string) (*CloudIgnoreData, error) {
endpoint := Endpoints.FetchIgnores

bytes, err := api.makeRequest(endpoint.Route, endpoint.HttpMethod,
Message{
Type: MessageTypeSuccess,
Data: CloudIgnorePayload{
Project: fullname,
LocalIgnores: localIgnores,
Project: fullname,
LocalIgnores: localIgnores,
PullRequestNumber: os.Getenv("PR_NUMBER"),
},
})
if err != nil {
Expand Down

0 comments on commit c0fa3d5

Please sign in to comment.