Sharing varibles between pipelines

Stevedan Ogochukwu Omodolor Omodia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2025

At the moment, I have pipelines that run during a pull request and one when we merge to main. I want to be able to share data between them for version control but I am not able to do so. Just for more context, see example below:

pipelines:
pull-requests:
develop*:
-step: export dummy_data=1
branch:
main:
script:
- echo "$dummy_data"

 I tried a suggestions in one of the forums that recommended to use the trigger pipeline( if you have any other suggestions please let me know. 

Current the trigger pipeline is as follows(i include the promote pipe in the pull request pipe. 

 

step: &promote
name: Promote
script:
- source version.env
- BB_TOKEN=secret
- pipe: atlassian/trigger-pipeline:5.8.1
variables:
BITBUCKET_ACCESS_TOKEN: $BB_TOKEN
REPOSITORY: <name-of-repo>
REF_TYPE: 'branch'
REF_NAME: develop_branch
PIPELINE_VARIABLES: >
[
{
"key": "dummy_data",
"value": "1"
}
]
WAIT: 'true'


Every time I run with this step I get the following error, I am not sure what I am setting wrongly. 


✖ Error: {"error": {"message": "Bad request", "detail": "Requested selector is not found in bitbucket-pipelines.yml.", "data": {"key": "result-service.pipeline.selector-not-found", "arguments": {}}}} 


Is there anyway I can also do this without pasting the token in code, I am fund of that due to safety reasons. Is there a way to store this as a global variable that can be accessed by all repositories?

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events