Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/content/changelog/workers/2025-06-10-default-env-vars.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Default system environment variables in Workers Builds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I would consider these "default system environment variables" if they are variables related to the git commit/branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the title! We do call them "system environment variables" in the docs, but agreed, not super accurate.

description: Workers Builds now injects default environment variables
products:
- workers
date: 2025-06-10T01:00:00Z
---

[Workers Builds](/workers/ci-cd/builds/) connects your Worker to a [Git repository](/workers/ci-cd/builds/git-integration/), and automates building and deploying your code on each pushed change.

To make CI/CD pipelines even more flexible, Workers Builds now automatically injects [default system environment variables](/workers/ci-cd/builds/configuration/#environment-variable) into your build process (much like the defaults in [Cloudflare Pages projects](/pages/configuration/build-configuration/#environment-variables)). You can use these variables to customize your build process based on the deployment context, such as the branch or commit.

The following system environment variables are injected by default:

| Environment Variable | Injected value | Example use-case |
| ----------------------- | ------------------------------- | --------------------------------------------------------------------------------------- |
| `CI` | `true` | Changing build behavior when run on CI versus locally |
| `WORKERS_CI` | `1` | Changing build behavior when run on Workers Builds versus locally |
| `WORKERS_CI_BUILD_UUID` | `<build-uuid-of-current-build>` | Passing the Build UUID along to custom workflows |
| `WORKERS_CI_COMMIT_SHA` | `<sha1-hash-of-current-commit>` | Passing current commit ID to error reporting, for example, Sentry |
| `WORKERS_CI_BRANCH` | `<branch-name-from-push-event` | Customizing build based on branch, for example, disabling debug logging on `production` |

You can override these default values and add your own custom environment variables by navigating to **your Worker** > **Settings** > **Environment variables**.

Learn more in the [Build configuration documentation](/workers/ci-cd/builds/configuration/#environment-variables).
Loading