#Getting Git Commit hash in Railway (Nixpacks) enviornment

9 messages · Page 1 of 1 (latest)

fluid horizon
#

Hey all, how could I get the current git commit hash for an image published on railway? (aka in a nixpacks enviornment) My current current method of running git rev-parse --verify HEAD does not work in said context.

rose ravineBOT
#

Project ID: N/A

jolly crater
#

process.env.RAILWAY_GIT_COMMIT_SHA or $RAILWAY_GIT_COMMIT_SHA

fluid horizon
#

Awesome, thanks!

weary gyro
#

Hello!

Do I need to set-up something for RAILWAY_GIT_COMMIT_SHA to be available?
running

railway shell
export

wont show any RAILWAY_xx variables

tame scarab
#

RAILWAY_ variables are only available inside the railway deployment itself

#

shell shows service variables you've added