Deploy button - make input fields required

Hello there, I’m building an application where some environments variables are required in order for the website to be built.

I’m using the awesome deploy button offered by Netlify where we can use a github repo as a template.

However, people can deploy the website without filling out the inputs.

That’s how my netlify.toml file looks like:

[template]
  incoming-hooks = ["Contentful"]

[template.environment]
  CONTENTFUL_SPACE_ID = ""
  CONTENTFUL_API_TOKEN = ""
  CONTENTFUL_PREVIEW_TOKEN = ""

[build]
  publish = "public/"
  command = "npm run build"

It’s a Gatsby application.

My questions are:

  1. Could I make the generated input fields from the env variables required?
  2. Could I somehow set a default value for those fields via query string parameters?

Something like:

https://app.netlify.com/start/deploy?repository=<REPO_URL>&CONTENTFUL_SPACE_ID=123&CONTENTFUL_API_TOKEN=abc&CONTENTFUL_PREVIEW_TOKEN=xyz

Thank you all!

Hey @CezarSampaio,

From memory, there’s not a systematic way which I can think of to make people add these variables. However, you could create a build plugin which checks to see if these variables are populated and output useful information to the deploy log?