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:Jump to solution
the
RAILWAY_
variables are only available to your app when deployed to railway7 Replies
Project ID:
4c244bec-c9dc-4d97-b44d-c09dcf0b97d3
Project ID: 4c244bec-c9dc-4d97-b44d-c09dcf0b97d3
railway shell
only opens a local shell, with the variables that you have entered into the service variables yourselfSolution
the
RAILWAY_
variables are only available to your app when deployed to railwayand more specifically they are only available to the app itself
got it, i will try to check it in the app itself using logs.
thank you for the quick response
no problem!