"avi:bitbucket:pushed:repository" event not working properly

Julius Pravtchev April 3, 2024

Hi guys,

I'm working on a simple forge app for Bitbucket Cloud. The app should do some stuff when a developer is pushing his/her code up to the repository. 

As observed from the docs, the "avi:bitbucket:pushed:repository" event should handle this. 

My manifest.yml looks like the following:

 

permissions:
  scopes:
    - 'read:repository:bitbucket'

modules:
  trigger:
    - key: push-event-trigger-hello-world
      function: main
      events:
        - avi:bitbucket:created:repository
        - avi:bitbucket:updated:repository
        - avi:bitbucket:pushed:repository

  function:
    - key: main
      handler: index.run

app:
  id: ari:cloud:ecosystem::app/***

 

And my index.jsx is currently only a logger.

 

export async function run(event, context) {

    console.log(event)
    console.log("########")
    console.log(context)
    console.log('#######')

    if ( event.eventType == "avi:bitbucket:updated:repository" )
        console.log("repository update event")      

    if ( event.eventType == "avi:bitbucket:pushed:repository" )
        console.log("repository pushed event")      
}

 

However, the app is not receiving the "push" events; while updating or creating a repository works fine. So the app seems to have the necessary permissions, but I do not know how do solve the missing "push" events.

 

Are there any additional configurations necessary on the workspace or the repository?

 

Thanks for your help in advance

Julius

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Justin Venkitachalam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2024

Hi Julius,

It looks like our documentation has the incorrect event name for the repository pushed event. The correct event name is 'avi:bitbucket:push:repository'. I've tested this with a Forge app and can confirm the events are working as expected.

Thanks for bringing this to our attention, we'll get the docs updated with the correct event name. Please let us know if you run into any other issues with the event.

Cheers,

Justin

Julius Pravtchev April 4, 2024

Hey Justin,

thanks for your response! I tested it and it works.

 

Thanks!

Julius

TAGS
AUG Leaders

Atlassian Community Events