Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Can I Change repository environment variable value from shell script?

Edited

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 "'

 

 

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 13, 2023

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

Suggest an answer

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

Atlassian Community Events