Github Related Environment Variables missing

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!
Railway Docs
Variables | Railway Docs
Documentation for Railway
Solution:
Got it! modified next.config.js ``` /** @type {import('next').NextConfig} */...
Jump to solution
8 Replies
Percy
Percy6mo ago
Project ID: c54e2141-8124-42c6-b31d-3158cb0a74a3
jigglyjams
jigglyjams6mo ago
c54e2141-8124-42c6-b31d-3158cb0a74a3
jigglyjams
jigglyjams6mo ago
No description
No description
Brody
Brody6mo ago
those variables are auto injected, you can not set them yourself
jigglyjams
jigglyjams6mo ago
Do you know if its possible to access them from a nextjs project? Will they be prepended with NEXT_PUBLIC?
Brody
Brody6mo ago
no they wouldn't, that's something you'd need to do in a pre-run script
Solution
jigglyjams
jigglyjams6mo ago
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;
/** @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
Brody
Brody6mo ago
glad you where able to solve
Want results from more Discord servers?
Add your server