Skip to content

Commit d732874

Browse files
committed
Added changes field in push event struct for Bitbucket server
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 <[email protected]>
1 parent cf63ad9 commit d732874

File tree

1 file changed

+18
-2
lines changed
  • pkg/provider/bitbucketserver/types

1 file changed

+18
-2
lines changed

pkg/provider/bitbucketserver/types/types.go

+18-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,29 @@ type PullRequestEvent struct {
2323
}
2424

2525
type PushRequestEventChange struct {
26-
ToHash string `json:"toHash"`
27-
RefID string `json:"refId"`
26+
Ref Ref `json:"ref"`
27+
FromHash string `json:"fromHash"`
28+
ToHash string `json:"toHash"`
29+
RefID string `json:"refId"`
30+
Type string `json:"type"`
31+
}
32+
33+
type Ref struct {
34+
ID string `json:"id"`
35+
DisplayID string `json:"displayId"`
36+
Type string `json:"type"`
2837
}
2938

3039
type PushRequestEvent struct {
40+
EventKey string `json:"eventKey"`
3141
Actor bbv1.UserWithLinks `json:"actor"`
3242
Repository bbv1.Repository `json:"repository"`
3343
Changes []PushRequestEventChange `json:"changes"`
3444
Commits []bbv1.Commit `json:"commits"`
45+
ToCommit ToCommit `json:"toCommit"`
46+
}
47+
48+
type ToCommit struct {
49+
bbv1.Commit
50+
Parents []bbv1.Commit `json:"parents"` // bbv1.Commit also has Parents field, but its Parents has only two fields while actual payload has more.
3551
}

0 commit comments

Comments
 (0)