Workers Builds now injects commit SHA and branch as environment variables
Workers Builds automatically injects default environment variables including commit SHA, branch name, and build UUID into your build process, allowing you to customize CI/CD pipelines based on deployment context. You can override these or add custom variables in your Worker settings.
Workers Builds connects your Worker to a Git repository, 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 environment variables into your build process (much like the defaults in Cloudflare Pages projects). You can use these variables to customize your build process based on the deployment context, such as the branch or commit.
The following 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.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for macOS 2026.8.2100.0
GA release for macOS Cloudflare One Client with improved split tunnel handling that no longer briefly blocks traffic during reconnects, support for non-RFC 1918 local IPv4 networks, faster connects with lower memory use, and numerous reliability fixes across DNS, reauthentication, and client stability.
Cloudflare One Client for Windows 2026.8.2100.0
This GA release improves split tunnel reliability, adds support for non-RFC 1918 local networks, optimizes connection performance with faster reconnections and lower memory usage, and includes numerous bug fixes for DNS, registration, and network handling. The client now features a service recovery mechanism that automatically restarts on system unlock and better handles large hosts files without blocking traffic.
Cloudflare One Client for Linux 2026.8.2100.0
New GA release for Linux with improved split tunnel handling that no longer briefly blocks traffic during reconnects, support for non-RFC 1918 local IPv4 networks, faster tunnel reconnections, and lower memory usage. Includes numerous stability and reliability fixes for DNS, reconnection behavior, and crash issues.