I need to pass information from a merged PR to the pipeline that merged PR triggered. I don't see any available environment variables that would pass that info.
How can I get it? Specifically, I'd like to know the build number of the pipeline for the PR that triggered the branch pipeline for the branch the PR merged into.
Thanks
Hi John,
Just to make sure I understand:
The only way I could think of doing this would be to write a script that would make an API call to grep the previous Pipeline build # and set this as an environment variable in the branch pipeline:
The reason for this is that there is no way of sharing environment variables between builds, only steps within the same build (by using artifacts):
https://jira.atlassian.com/browse/BCLOUD-20294
Cheers!
- Ben (Bitbucket Cloud Support)
Sorry for the late reply. I ended up depending on the git log. I scrape the top of the commit log for the PR#. This works for the use case I had when I asked this in July.
Today, I have a different use case, but still need to know what PR merge triggered the current build.
I don't think the solution you offered would work because getting the most recent pipeline build would not necessarily be the PR that was just merged. The PR pipeline for the PR that was merged could have been run 2 days before someone clicked the button to merge it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We'll need to look at your YML config/build environment to assist you further on this.
To do so - we'll need a support ticket. I can see you have access to a Premium workspace, and therefore qualify for support directly with our support team - please raise a ticket so we can assist further:
If you have issues raising a ticket, please let us know your timezone so we can raise one on your behalf with the appropriate team.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.