Skip to content

Commit

Permalink
Added changes field in push event struct for Bitbucket server
Browse files Browse the repository at this point in the history
added changes field in push event struct for Bitbucket to
make it available in PipelineRun's dynamic variable

https://issues.redhat.com/browse/SRVKP-6981

Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
  • Loading branch information
zakisk committed Jan 20, 2025
1 parent cf63ad9 commit d732874
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions pkg/provider/bitbucketserver/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,29 @@ type PullRequestEvent struct {
}

type PushRequestEventChange struct {
ToHash string `json:"toHash"`
RefID string `json:"refId"`
Ref Ref `json:"ref"`
FromHash string `json:"fromHash"`
ToHash string `json:"toHash"`
RefID string `json:"refId"`
Type string `json:"type"`
}

type Ref struct {
ID string `json:"id"`
DisplayID string `json:"displayId"`
Type string `json:"type"`
}

type PushRequestEvent struct {
EventKey string `json:"eventKey"`
Actor bbv1.UserWithLinks `json:"actor"`
Repository bbv1.Repository `json:"repository"`
Changes []PushRequestEventChange `json:"changes"`
Commits []bbv1.Commit `json:"commits"`
ToCommit ToCommit `json:"toCommit"`
}

type ToCommit struct {
bbv1.Commit
Parents []bbv1.Commit `json:"parents"` // bbv1.Commit also has Parents field, but its Parents has only two fields while actual payload has more.
}

0 comments on commit d732874

Please sign in to comment.