惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
H
Help Net Security
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
A
About on SuperTechFans
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
I
InfoQ
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
U
Unit 42
The Cloudflare Blog
Y
Y Combinator Blog

Netlify Changelog

Gemini 3.5 Flash now available in Agent Runners 4 Nuxt CVEs: what Netlify users need to know Gemini 3.5 Flash now available in AI Gateway Agent Runners workflow improvements Next.js & React security release (May 2026): what to know Block project transfers out of your team Gemini 3.1 Flash-Lite now available in AI Gateway OpenAI GPT-5.5 Instant now available in AI Gateway New `netlify logs` CLI command Deploy to Netlify with Stripe Projects Netlify Database is now generally available OpenAI GPT-5.5 and GPT-5.5 Pro in AI Gateway & Agent Runners Rename an agent run GPT Image 2 now available in AI Gateway New frontend-design skill for Agent Runners Claude Opus 4.7 now available in AI Gateway and Agent Runners Pricing updates for Credit-based plans New sorting and filter controls on the Members page Netlify Database GA coming soon, no new databases for now Deploy logs streaming is now faster Netlify CLI adds prompt-based creation and anonymous deploys Deploy from Codex with the Netlify Plugin Hydrogen with React Router 7 now supported on Netlify Monitor credit usage by day Invoices for Enterprise Available on the Billing Page AI app development on production infrastructure with Netlify Introducing Prompt Templates OpenAI GPT-5.4 Nano and GPT-5.4 Mini in AI Gateway Change your pricing plan Internal Builder Role & Project Access Controls
Branch-specific environment variable values from the Netl...
Nahrin Jalal · 2022-08-23 · via Netlify Changelog

Teams can manage scopes and deploy contexts on environment variables from the Netlify UI. This beta in Labs now includes the ability to set a different value for specific branches!

image

If you prefer to use the Netlify CLI or API to interact with your Sites, the “Scopes and deploy contexts for environment variables” beta has also been updated with support for these workflows.

Set branch values on environment variables from the UI

Some projects might require special configurations on long-lived branches, such as staging. In other cases, you might need to preview site updates that require a specific API token—before those changes land in production.

Developers can now set one environment variable key, with a different value on specific branches:

image

With this change, netlify.toml configuration or build plugins are no longer needed for branch values. The value for branch staging will be applied to any deploy context initiated from staging, including Deploy Previews.

For teams with Sites opted into the beta, branch value options are available in Site Settings > Environment Variables, as well as Team Settings > Environment Variables (Pro plan and above). Shared environment variables will apply to all Sites in your Team.

Manage environment variables using the Netlify CLI or API

The Labs beta has also been updated so that teams can scope environment variables, or set values for specific deploy contexts, from the Netlify CLI or API. This includes the ability to set a branch value.

Starting with Netlify CLI version 11.5.0, developers can use --scope and --context flags when reading and writing environment variables with netlify env commands. You can also pass the --context flag to netlify build or netlify dev, to emulate a build in the given deploy context. Run npm i -g netlify-cli on the command line to install the latest version of the Netlify CLI.

As an example, let’s suppose you want to set a specific value for the CONTEXTUAL_VAR key on your staging branch. You can:

  • Run netlify env:set with the flag and keyword --context branch:staging
  • Check your work using netlify env:list --context branch:staging
  • Locally emulate builds from this branch using netlify dev --context branch:staging

image

Likewise, the Netlify API includes new Environment Variables endpoints, with which you can create, read, update, or delete environment variables. Teams with sites in the beta should use these new endpoints to manage their environment variables, rather than Site endpoints.

You can learn more about the new API endpoints and CLI updates in the docs.

Try out the new environment variables experience

This marks the last major update to “Scopes and deploy contexts for environment variables” before the new experience becomes generally available. To take advantage of the new functionality and stronger encryption for secrets now, enable the beta in Labs and migrate your sites to the new experience. Please let us know what feedback you have, we always appreciate getting your input!