hi there!
imagine there is a step within your pipeline that commits something back into the repository as described here: https://support.atlassian.com/bitbucket-cloud/docs/push-back-to-your-repository/.
The same pipeline contains a deployment step as well, so first we add a new commit in Step A and then deploy our code to production on step B. How do I tell the deployment step B to deploy not only the commit the current pipeline is running for but also the dynamically added commit that has been added in Step A?
My workaround for this would probably be disabling automatic cloning, adding a repository variable for git repo access and manually cloning the latest commit in the current branch... but I wonder if there is a cleaner way to reach that goal.
Here's a little example pipeline config, maybe it's easier to understand the issue like that:
pipelines:
default:
- step:
script:
- echo "Made a change in build ${BITBUCKET_BUILD_NUMBER}" >> changes.txt
- git add changes.txt
- git commit -m "[skip ci] Updating changes.txt with latest build number."
- git push
- step:
deployment: production
script:
# this will not deploy the commit from step one, just the current pipeline commit.
- rsync -avh . root@production:/var/application/