Skip to content

Build metadata by hosting provider

Build metadata connects a note to the preview revision that received it.

<meta name="gutternote:branch" content="fix-nav" />
<meta name="gutternote:commit" content="9f2c1ab000000000000000000000000000000000" />
<meta name="gutternote:pr" content="128" />
TagWhat it controls
gutternote:branchGives a built-in agent the branch behind the preview, and lets a connected agent on that branch find the note.
gutternote:commitIdentifies the code revision the reviewer saw.
gutternote:prSupplies the PR number as metadata and lets a connected agent filter notes by PR. GitHub publication also requires a verified repository and commit.

Provider variables

ProviderBranchCommitPull request
VercelVERCEL_GIT_COMMIT_REFVERCEL_GIT_COMMIT_SHAVERCEL_GIT_PULL_REQUEST_ID
NetlifyBRANCHCOMMIT_REFREVIEW_ID
GitHub ActionsGITHUB_HEAD_REF, then GITHUB_REF_NAMEGITHUB_SHAParse GITHUB_REF=refs/pull/<number>/... or set GUTTERNOTE_PR
GitLab CICI_COMMIT_REF_NAMESet GUTTERNOTE_COMMIT_SHACI_MERGE_REQUEST_IID
BuildkiteBUILDKITE_BRANCHSet GUTTERNOTE_COMMIT_SHABUILDKITE_PULL_REQUEST
Cloudflare PagesCF_PAGES_BRANCHSet GUTTERNOTE_COMMIT_SHASet GUTTERNOTE_PR
RenderSet GUTTERNOTE_BRANCH from RENDER_GIT_BRANCHSet GUTTERNOTE_COMMIT_SHA from RENDER_GIT_COMMITSet GUTTERNOTE_PR
Another hostGUTTERNOTE_BRANCHGUTTERNOTE_COMMIT_SHAGUTTERNOTE_PR

The Vite plugin reads these variables and emits the tags. Without Vite, write the same values into the page head during the build.

Rules

  • Commit values must contain 7 to 40 hexadecimal characters.
  • GitHub preview verification accepts any of these lengths. The value must be the start of one of the pull request’s commits.
  • Pull request values must be positive integers.
  • Unsubstituted strings such as ${GITHUB_SHA} are ignored.
  • The browser cannot recover CI variables after deployment. Emit them during the build.
  • Explicit gutternote:* tags win over Vercel-specific fallbacks and hostname inference.

Where it is required

Emit all three tags on every preview and staging build that loads the widget. Production can go without them.

A note still saves without them. But without a pull request number it is not in the pull request summary. Without a branch or pull request, a connected agent working that branch never sees it.

Tags do not establish repository identity. New previews publish to GitHub only after the App verifies the repository, PR and full head commit. Older unbound previews remain readable without GitHub comments or checks. See Connect GitHub.