Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get all commits when receiving repo:refs_changed webhook?

Peter D
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 8, 2024

Hi,

 

Let's take the following example:

- You create a branch off main, named branch-nr6

- You create 3 commits but don't push them

- Then you push all 3 at once

- Bitbucket DC sends a repo:refs_changed webhook with the following content:

{
    "eventKey": "repo:refs_changed",
    "date": "2024-03-20T18:01:31+0000",
    "actor": {
        "<redacted>": "redacted a few non-relevant properties here"
    },
    "repository": {
        "<redacted>": "redacted a few non-relevant properties here"
    },
    "changes": [
        {
            "ref": {
                "id": "refs/heads/branch-nr6",
                "displayId": "branch-nr6",
                "type": "BRANCH"
            },
            "refId": "refs/heads/branch-nr6",
            "fromHash": "0000000000000000000000000000000000000000",
            "toHash": "44a4247e58d4098d7136821abf2e370096e6afbb",
            "type": "ADD"
        }
    ]
}

 

As you can see above the fromHash property is empty. So how do we tell there were 3 commits?

Thanks

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events