---
title: Access git commit sha and branch name as environment variables in Workers Builds
description: Workers Builds now automatically injects environment variables containingGit metadata, including the commit SHA and branch name.
image: https://edgetunnel-b2h.pages.dev/changelog-preview.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://edgetunnel-b2h.pages.dev/changelog/llms.txt  
> Use this file to discover all available pages before exploring further. 

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://edgetunnel-b2h.pages.dev/changelog/rss/index.xml) [ View RSS feeds ](https://edgetunnel-b2h.pages.dev/fundamentals/new-features/available-rss-feeds/) 

![hero image](https://edgetunnel-b2h.pages.dev/_astro/hero.CVYJHPAd_26AMqX.svg) 

[ ← Back to all posts ](https://edgetunnel-b2h.pages.dev/changelog/) 

## Access git commit sha and branch name as environment variables in Workers Builds

Jun 10, 2025 

[ Workers ](https://edgetunnel-b2h.pages.dev/workers/) 

[Workers Builds](https://edgetunnel-b2h.pages.dev/workers/ci-cd/builds/) connects your Worker to a [Git repository](https://edgetunnel-b2h.pages.dev/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](https://edgetunnel-b2h.pages.dev/workers/ci-cd/builds/configuration/#environment-variables) into your build process (much like the defaults in [Cloudflare Pages projects](https://edgetunnel-b2h.pages.dev/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](https://edgetunnel-b2h.pages.dev/workers/ci-cd/builds/configuration/#environment-variables).

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://edgetunnel-b2h.pages.dev/changelog/post/2025-06-10-default-env-vars/#page","headline":"Access git commit sha and branch name as environment variables in Workers Builds · Changelog","description":"Workers Builds now automatically injects environment variables containingGit metadata, including the commit SHA and branch name.","url":"https://edgetunnel-b2h.pages.dev/changelog/post/2025-06-10-default-env-vars/","inLanguage":"en","image":"https://edgetunnel-b2h.pages.dev/changelog-preview.png","dateModified":"2025-06-10","datePublished":"2025-06-10","publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://edgetunnel-b2h.pages.dev/#website","name":"Cloudflare Docs","url":"https://edgetunnel-b2h.pages.dev/"}}
```
