Access Environment Variables in config.yml
#7672
-
|
I've searched but as of yet have not found a straightforward way to access environment variables in |
Beta Was this translation helpful? Give feedback.
Answered by
martinjagodic
Nov 18, 2025
Replies: 1 comment 1 reply
-
|
This is how I do it to set the branch: # config.yml
backend:
name: git-gateway
branch: __BRANCH__# build.sh
sed -i "s|__BRANCH__|${HEAD}|g" static/admin/config.yml
hugo --gc --minify -b $URL # Your build command. I use Hugo in this case# netlify.toml
[build]
command = "chmod +x ./build.sh && ./build.sh" |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dbinetti
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is how I do it to set the branch: