I am using the Bitbucket pipe bitbucket-pipe-release:5.0.1 to push a custom pipe to our managed repository. Both pushing and pulling succeeds, and the custom pipe works fine.
Recently, I added a step to my pipeline which will, in addition to releasing the custom pipe, create a tag, update the version, and commit all changes to the master branch, as per bitbucket-pipe-release's documentation. This branch only triggers whenever the committed .env file changes. When I run the step, however, it fails to push the changes to the main branch:

Here is the step definition:
push: &push
step:
name: Push and tag new version
runs-on:
- gaims
image: python:3.10
script:
- APP_VERSION=$(cat .env | grep -oP "APP_VERSION=[/']?\K[\d/.]*")
- pipe: docker://bitbucketpipelines/bitbucket-pipe-release:5.0.1
variables:
REGISTRY_USERNAME: $REGISTRY_USER
REGISTRY_PASSWORD: $REGISTRY_PWD
IMAGE: $REGISTRY_URL/bitbucket/$BITBUCKET_REPO_SLUG
REGISTRY_URL: $REGISTRY_URL
VERSION: $APP_VERSION
BITBUCKET_BRANCH: main
CHANGELOG: 'false'
condition:
changesets:
includePaths:
- ".env"
services:
- docker
pipelines:
default:
- <<: *test
- <<: *push-dev
branches:
develop:
- <<: *test
- <<: *push
main:
The main branch is indeed called 'main' and I have not restricted read/write access to it. Why does the pipeline fail?