Bitbucket Cloud is a Git-based code and CI/CD tool optimized for teams using Jira.
Go to siteThe BitBucket API taps the potential of BitBucket's Git-based version control system, enabling you to automate workflows around code commits, pull requests, and overall repository management. With this API, you can streamline the collaboration process, enforce coding standards, or integrate with other tools to create a cohesive development ecosystem. Pipedream, as a serverless integration and compute platform, provides a seamless environment to connect BitBucket with various apps and services, enabling you to harness its API for efficient, customized automations.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
bitbucket: {
type: "app",
app: "bitbucket",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.bitbucket.org/2.0/user`,
headers: {
Authorization: `Bearer ${this.bitbucket.$auth.oauth_access_token}`,
},
})
},
})
Automated Code Quality Checks: Trigger a workflow on Pipedream whenever a new commit is pushed to a BitBucket repository. The workflow could then run code quality checks using tools like ESLint or SonarQube, and report the results back as comments on the commit or pull request in BitBucket.
Deployment Automation: Set up a Pipedream workflow to deploy the latest code pushed to a specific BitBucket branch. On push events, the workflow can trigger deployment scripts on platforms like AWS, Google Cloud, or Azure, and notify your team via Slack or email upon successful deployment.
Syncing Issues Across Platforms: Create a workflow that synchronizes BitBucket issues with an external project management tool like Jira or Trello. Whenever an issue is created or updated in BitBucket, it reflects on the connected platform in real-time, ensuring seamless tracking and management of development tasks.
Emit new event when a new commit is pushed to a branch. See docs here
Emit new event when a new pull request is created in a repository. See docs here
Emit new event when a new branch is created. See docs here
Emit new event when a commit receives a comment. See docs here
Emit new event when an event occurs from any repository belonging to the user. See docs here
BitBucket uses OAuth authentication. When you connect your BitBucket account, Pipedream will open a popup window where you can sign into BitBucket and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any BitBucket API.
Pipedream requests the following authorization scopes when you connect your account:
account
account:write
team:write
repository:write
pullrequest:write
snippet:write
issue:write
email
wiki
webhook
GET
https://bitbucket.org/site/oauth2/authorize
?
client_id={{oauth.client_id}}
&
state={{oauth.state}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://bitbucket.org/site/oauth2/access_token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
redirect_uri={{oauth.redirect_uri}}
POST
https://bitbucket.org/site/oauth2/access_token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}