You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.