-
Notifications
You must be signed in to change notification settings - Fork 10k
adds changelog for new default env vars in workers builds #22988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f8160d7
adds changelog for new default env vars in workers builds
korinne faf0f7f
mentions that this is a previous Pages feature
korinne bfac0a9
updates title
korinne 3e8d189
Update src/content/changelog/workers/2025-06-10-default-env-vars.mdx
korinne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/content/changelog/workers/2025-06-10-default-env-vars.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| title: Workers Builds adds Git context and build variables for flexible pipelines | ||
| description: Workers Builds now automatically injects environment variables containingGit metadata, including the commit SHA and branch name. | ||
| 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 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 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). | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.