Skip to content

Add pull_request trigger to build-branch workflow#2299

Draft
jonathanKingston wants to merge 2 commits intomainfrom
jkt/auto/workflow-pr-trigger-state-9f80
Draft

Add pull_request trigger to build-branch workflow#2299
jonathanKingston wants to merge 2 commits intomainfrom
jkt/auto/workflow-pr-trigger-state-9f80

Conversation

@jonathanKingston
Copy link
Copy Markdown
Contributor

@jonathanKingston jonathanKingston commented Feb 20, 2026

The comment job now runs on PR open/reopen in addition to push. On pull_request events, it resolves the existing pr-releases/ build branch (created by the prior push) via git ls-remote and posts the comment immediately — no rebuild needed.

Refactored the comment step into a separate job so the same template is used for both triggers.

Asana Task/Github Issue:

Description

Testing Steps

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Note

Low Risk
Workflow-only changes to GitHub Actions triggers and PR commenting; no production code, secrets, or data handling logic modified.

Overview
Adds a pull_request trigger (open/reopen) to the build-branch GitHub Actions workflow so PRs get the build-branch preview comment immediately.

Refactors commenting into a separate comment job that resolves the existing pr-releases/<source-branch> via git ls-remote and posts/updates the bot comment; for push events it still finds PRs by head branch, and it skips commenting when the build branch doesn’t exist.

Written by Cursor Bugbot for commit 32f11b3. This will update automatically on new commits. Configure here.

The comment job now runs on PR open/reopen in addition to push.
On pull_request events, it resolves the existing pr-releases/ build
branch (created by the prior push) via git ls-remote and posts the
comment immediately — no rebuild needed.

Refactored the comment step into a separate job so the same template
is used for both triggers.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 20, 2026

Build Branch

Branch pr-releases/jkt/auto/workflow-pr-trigger-state-9f80
Commit 297953d0bf
Updated February 20, 2026 at 6:23:24 PM UTC

Static preview entry points

QR codes (mobile preview)
Entry point QR code
Docs QR for docs preview
Static pages QR for static pages preview
Integration pages QR for integration pages preview

Integration commands

npm (Android / Extension):

npm i github:duckduckgo/content-scope-scripts#pr-releases/jkt/auto/workflow-pr-trigger-state-9f80

Swift Package Manager (Apple):

.package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/jkt/auto/workflow-pr-trigger-state-9f80")

git submodule (Windows):

git -C submodules/content-scope-scripts fetch origin pr-releases/jkt/auto/workflow-pr-trigger-state-9f80
git -C submodules/content-scope-scripts checkout origin/pr-releases/jkt/auto/workflow-pr-trigger-state-9f80
Pin to exact commit

npm (Android / Extension):

npm i github:duckduckgo/content-scope-scripts#297953d0bf5bb3830cc4f09ad10fa8d2a90263bb

Swift Package Manager (Apple):

.package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "297953d0bf5bb3830cc4f09ad10fa8d2a90263bb")

git submodule (Windows):

git -C submodules/content-scope-scripts fetch origin pr-releases/jkt/auto/workflow-pr-trigger-state-9f80
git -C submodules/content-scope-scripts checkout 297953d0bf5bb3830cc4f09ad10fa8d2a90263bb

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 20, 2026

[Beta] Generated file diff

Time updated: Fri, 20 Feb 2026 18:23:35 GMT

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread .github/workflows/build-branch.yml Outdated
Pass github.event.pull_request.head.ref, github.ref_name, and
github.event_name through env vars instead of inline ${{ }}
expansion in the shell script. The pull_request trigger accepts
PRs from forks, so head.ref is attacker-controlled and could
contain shell metacharacters.
@jonathanKingston
Copy link
Copy Markdown
Contributor Author

@laghee we discussed this at some point, I've not really looked through the change that much. I think it makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants