2 years ago
Hi!
I can't find RAILWAY_GIT_COMMIT_SHA and other Git Variables listed in the docs
(https://docs.railway.app/reference/variables) on my build.
Should I enable something?
My deploy is triggerd by github so, as I read the docs, they should be available.
13 Replies
2 years ago
Those variables are auto injected into your depoyment's env variables when you deploy, you can't really find them anywhere
2 years ago
so they aren't available on my app on code execution, only during build. is that it?
2 years ago
what i'm trying to achieve is inform Appsignal.com of my current's deploy git sha
2 years ago
so they aren't available on my app on code execution, only during build. is that it?
They'll be available during code execution, I'm just saying you wouldn't find it anywhere in Railway's predefined service variable list in your service config; Do you mean to say they appear as undefined during code execution?
2 years ago
Exactly. On my code (ruby) I search through all available ENV variables and the is no RAILWAY_GIT_xxx
2 years ago
thx
2 years ago
Unfortunately I was not able to reproduce with a deployment made from GitHub -
https://utilities.up.railway.app/env-vars?prefix=RAILWAY_GIT_
2 years ago
I deploy with nixpacks. Same thing?
brody
These variables would be available at runtime as demonstrated.
7 months ago
Would be good if i could use this on the variables list so i can rename to another var...
Attachments
7 months ago
You could always assign the variable's value to another variable from within a build command or similar -
VITE_GIT_SHA=$RAILWAY_GIT_COMMIT_SHA