Skip to content

Commit 9fec216

Browse files
committed
Documents environment variables present in workers builds
1 parent 79b5f45 commit 9fec216

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/content/docs/workers/ci-cd/builds/configuration.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,22 @@ It is recommended to consistently use the same API token across all uploads and
7878

7979
[Static assets](/workers/static-assets/) and [frameworks](/workers/framework-guides/) are now supported in Cloudflare Workers. Learn to set up Workers projects and the commands for each framework in the framework guides:
8080

81-
<DirectoryListing folder="workers/framework-guides" maxDepth={4}/>
81+
<DirectoryListing folder="workers/framework-guides" maxDepth={4} />
82+
83+
## Environment variables
84+
85+
If your project makes use of environment variables to build your site, you can provide custom environment variables:
86+
87+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
88+
2. In **Account Home**, select **Workers & Pages**.
89+
3. In **Overview**, select your Worker.
90+
4. Select **Settings** > **Environment variables**.
91+
92+
The following system environment variables are injected by default (but can be overridden):
93+
94+
| Environment Variable | Injected value | Example use-case |
95+
| ----------------------- | ------------------------------------- | --------------------------------------------------------------------------------------- |
96+
| `WORKERS_CI` | `1` | Changing build behaviour when run on Workers Builds versus locally |
97+
| `WORKERS_CI_BUILD_UUID` | `<build-uuid-of-current-build>` | Passing the Build UUID along to custom workflows |
98+
| `WORKERS_CI_COMMIT_SHA` | `<sha1-hash-of-current-commit>` | Passing current commit ID to error reporting, for example, Sentry |
99+
| `WORKERS_CI_BRANCH` | `<branch-name-of-current-deployment>` | Customizing build based on branch, for example, disabling debug logging on `production` |

0 commit comments

Comments
 (0)