Skip to content

[wrangler] Add pull request title to preview deployment annotations - #15307

Merged
for-the-kidz merged 5 commits into
mainfrom
mattprice/pr-title-annotation
Aug 25, 2026
Merged

[wrangler] Add pull request title to preview deployment annotations#15307
for-the-kidz merged 5 commits into
mainfrom
mattprice/pr-title-annotation

Conversation

@for-the-kidz

Copy link
Copy Markdown
Contributor

Follow-up to #14966 — adds the pull/merge request title to wrangler preview deployment annotations, using the same detection pattern as the PR number/URL, repository URL, and commit SHA added there.

Detects the title from:

  • GitHub Actions: pull_request.title in the GITHUB_EVENT_PATH event payload (the GITHUB_REF-only fallback path can't recover a title, since it isn't encoded in the ref)
  • GitLab CI: CI_MERGE_REQUEST_TITLE
  • Generic fallback: PULL_REQUEST_TITLE

Attaches it as the workers/pull_request_title annotation, alongside the existing workers/pull_request_number, workers/pull_request_url, workers/repository_url, and workers/commit_sha annotations. This is best effort — if no title can be detected, nothing changes.

CircleCI, Bitbucket Pipelines, and TeamCity are intentionally out of scope for this change:

  • CircleCI only exposes the title as a pipeline value (pipeline.event.github.pull_request.title) that isn't wired into a job's environment by default
  • Bitbucket Pipelines has no PR title env var at all
  • TeamCity requires an explicitly-configured "Pull Requests" build feature, unlike the other providers where this is automatic

Not surfaced in the wrangler preview CLI output, matching the existing precedent for workers/repository_url and workers/commit_sha (only the pull request URL gets a dedicated output line).


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation

A picture of a cute animal (not mandatory, but encouraged)

Note

This is a contribution from an AI agent: OpenCode, claude-sonnet-5.

Detects the pull/merge request title from GitHub Actions
(GITHUB_EVENT_PATH's pull_request.title) and GitLab CI
(CI_MERGE_REQUEST_TITLE), with a generic PULL_REQUEST_TITLE env var as
a provider-agnostic fallback. Attaches it to preview deployments as
the workers/pull_request_title annotation, alongside the existing
pull request number/URL, repository URL, and commit SHA annotations
added in #14966.

Other CI providers (CircleCI, Bitbucket Pipelines, TeamCity) are
intentionally not covered: CircleCI only exposes the title as a
pipeline value that isn't wired into a job's environment by default,
Bitbucket Pipelines has no PR title env var at all, and TeamCity
requires an explicitly-configured Pull Requests build feature. All
are out of scope for this change.

Not surfaced in the wrangler preview CLI output, matching the existing
precedent for workers/repository_url and workers/commit_sha (only the
pull request URL gets a dedicated output line).
@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0875601

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@cloudflare/deploy-helpers Minor
wrangler Minor
@cloudflare/remote-bindings Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Aug 21, 2026
@workers-devprod
workers-devprod requested review from a team and jamesopstad and removed request for a team August 21, 2026 20:04
@workers-devprod

workers-devprod commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@ask-bonk

ask-bonk Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

github run

@ask-bonk

ask-bonk Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@for-the-kidz Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15307

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15307

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15307

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15307

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15307

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15307

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15307

miniflare

npm i https://pkg.pr.new/miniflare@15307

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15307

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15307

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15307

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15307

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15307

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15307

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15307

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15307

wrangler

npm i https://pkg.pr.new/wrangler@15307

commit: 0875601

@ask-bonk

ask-bonk Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

github run

1 similar comment
@ask-bonk

ask-bonk Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

github run

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🙂

Comment thread packages/deploy-helpers/src/preview/shared.ts Outdated

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@ask-bonk

ask-bonk Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

github run

Co-authored-by: Dario Piotrowicz <dario@cloudflare.com>
@for-the-kidz
for-the-kidz enabled auto-merge (squash) August 24, 2026 14:47
@for-the-kidz
for-the-kidz merged commit 433fa98 into main Aug 25, 2026
59 of 60 checks passed
@for-the-kidz
for-the-kidz deleted the mattprice/pr-title-annotation branch August 25, 2026 14:53
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants