Custom environment variables set for a Pages project get lost

I have set up a small build as follows: https://github.com/survivejs/website-v3/blob/main/build.sh . In addition, I have specified several environment variables through the UI. Since I rely on workers in my Pages project, there is also
wrangler.toml
in place.

The problem is that when building, it's reporting Build environment variables: (none found) and printenv doesn't show any of the environment variables I defined through the UI. Curiously it's also missing variables like
CF_PAGES_COMMIT_SHA
that should be there based on documentation.

Do you know how to configure the project/Wrangler so that these environment variables don't get lost?
Was this page helpful?