Can't use RAILWAY_* env vars

following railway provided variables docs - https://docs.railway.app/develop/variables#railway-provided-variables i am trying to access railway provided variables in my project but gets an empty string value. for example: i tried to use railway shell into my service and echo $RAILWAY_GIT_COMMIT_SHA but got an empty string. in addition i tried to access it trough a ref, so i created a new shared env variable in my environment project in railway's app and add a shared variable called GIT_COMMIT_SHA, set its value to ${{ RAILWAY_GIT_COMMIT_SHA }}. Click Add, select the desired services and deploy. still it seems like GIT_COMMIT_SHA value is an empty string. it might be important to mention that i am using doppler to manage my secretes but still, it should not override those provided variables IMO. how can i access those variables?
Solution:
the RAILWAY_ variables are only available to your app when deployed to railway
Jump to solution
7 Replies
Percy
Percy2y ago
Project ID: 4c244bec-c9dc-4d97-b44d-c09dcf0b97d3
yarin_b
yarin_b2y ago
Project ID: 4c244bec-c9dc-4d97-b44d-c09dcf0b97d3
Brody
Brody2y ago
railway shell only opens a local shell, with the variables that you have entered into the service variables yourself
Solution
Brody
Brody2y ago
the RAILWAY_ variables are only available to your app when deployed to railway
Brody
Brody2y ago
and more specifically they are only available to the app itself
yarin_b
yarin_b2y ago
got it, i will try to check it in the app itself using logs. thank you for the quick response
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server