jigglyjams
HOBBYOP
2 years ago
I am having trouble accessing the github related environment variables for a project. The project is setup to deploy from github triggers and based on the docs here I was assuming I could access them by setting up a variable like:RAILWAY_GIT_REPO_OWNER = ${{RAILWAY_GIT_REPO_OWNER}}
Is this not the case? How does one set this up? Thanks!
7 Replies
2 years ago
those variables are auto injected, you can not set them yourself
Do you know if its possible to access them from a nextjs project? Will they be prepended with NEXT_PUBLIC?
2 years ago
no they wouldn't, that's something you'd need to do in a pre-run script
Got it!
modified next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
env: {
RAILWAY_GIT_REPO_NAME: process.env.RAILWAY_GIT_REPO_NAME,
RAILWAY_GIT_COMMIT_SHA: process.env.RAILWAY_GIT_COMMIT_SHA,
RAILWAY_GIT_REPO_OWNER: process.env.RAILWAY_GIT_REPO_OWNER,
}
};
export default nextConfig;Could be useful to add to docs somewhere
2 years ago
glad you where able to solve

