I know that I can set repository environment variable from repository setting,
but I need to change it's value inside my script and use it's new value some where else.
Is that possible?
my goal is sharing text message that is generated in build_script.sh to slack-notify message.
image: atlassian/default-image:4
pipelines:
custom:
new_publish:
- step:
name: new publish
script:
- echo "This step runs once you click the 'Run' button"
- /bin/sh build_script.sh
- pipe: atlassian/slack-notify:2.0.0
variables:
WEBHOOK_URL: $WEBHOOK_URL
MESSAGE: '"$MESSAGE that is generated in build_script.sh "'
Hi @Mustafa Abdelhakam and welcome to the community!
Yes, this is possible. If you use a command like
- myVar="some text"
where myVar is a Repository variable, then the changed value will be used in the following commands of the same step. Please note that this will change the value of the variable for that specific step only, not for any other steps, and it won't change the value set in the Repository settings.
If you want to change the value of a variable in the Repository settings you can use the following API endpoint:
If you have any questions, please feel free to let me know.
Kind regards,
Theodora
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.