Hi everyone,
I'm trying to create a Backstage template that pushes a generated file to an existing Bitbucket Cloud repository and automatically creates a pull request. However, I'm running into issues with the built-in actions.
What I've tried:
publish:bitbucketCloud - This tries to create a new repository instead of pushing to an existing one, and fails with:
Error: Unable to create repository, 403 Forbidden
Required scope: admin:repository:bitbucket
publish:bitbucketCloud:pull-request - This expects a branch to already exist and fails with:
Error: There are no changes to be pulled
My use case:
Generate a Terraform file from a template
Push it to an existing repo (e.g., bitbucket.org/workspace/my-infra-repo)
Create a PR automatically for review
Question:
Has anyone successfully implemented a workflow to push files to an existing Bitbucket Cloud repository using Backstage scaffolder actions?
Is there a combination of actions that works?
Do I need to create a custom scaffolder action using the Bitbucket API?
Are there any community plugins that solve this?
My setup:
Using Bitbucket Cloud (not Server)
API tokens configured with repository:write and pullrequest:write scopes
Any guidance would be greatly appreciated!