Skip to content

ci: make the main-image dispatch repo and ref configurable#3883

Merged
d-cs merged 3 commits into
mainfrom
ci-main-image-dispatch-repo-override
Jun 10, 2026
Merged

ci: make the main-image dispatch repo and ref configurable#3883
d-cs merged 3 commits into
mainfrom
ci-main-image-dispatch-repo-override

Conversation

@d-cs

@d-cs d-cs commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

The dispatch-main-image job was hard-gated to triggerdotdev/trigger.dev on the main ref. This makes it configurable via repository variables, all defaulting to the current values:

  • MAIN_IMAGE_DISPATCH_REPO — the repo allowed to dispatch (default triggerdotdev/trigger.dev).
  • MAIN_IMAGE_DISPATCH_REF_PREFIX — the ref-name prefix that dispatches, matched with startsWith(github.ref_name, …) (default main).
  • MAIN_IMAGE_DISPATCH_TARGET — the repository_dispatch target (default triggerdotdev/cloud).

The job is additionally gated on github.event_name == 'push'. This is necessary, not just defensive: the gate now keys off github.ref_name rather than the computed image tag, and ref_name is still main when release.yml invokes this workflow via workflow_call during a release — so without the event guard the job would fire during every release and fail on the absent CROSS_REPO_PAT. A version-equality check can't replace it because build-* tags strip the prefix to the version output.

Behaviour note: the intended dispatch paths — push to main, and push of a <prefix>* tag in a downstream repo — are push events and are unchanged. The one case that no longer dispatches is a manual workflow_dispatch run of publish.yml on main (it previously did, via the old version == 'main' check). That path is indistinguishable from a manual release by event name, so push-only is the clean discriminator.

Dispatching still requires CROSS_REPO_PAT, so setting the variables alone doesn't enable anything.

The dispatch-main-image gate was hardcoded to triggerdotdev/trigger.dev on
the main ref. Make both overridable via the MAIN_IMAGE_DISPATCH_REPO and
MAIN_IMAGE_DISPATCH_REF_PREFIX repository variables, each defaulting to the
current value so behaviour is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 16da774

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR updates the GitHub Actions publish workflow to make the dispatch-main-image job's trigger condition configurable. The job now checks github.repository against vars.MAIN_IMAGE_DISPATCH_REPO (defaulting to triggerdotdev/trigger.dev), requires github.event_name == 'push', and uses startsWith(github.ref_name, vars.MAIN_IMAGE_DISPATCH_REF_PREFIX || 'main') instead of comparing a published version output. The repository-dispatch action's repository input is now vars.MAIN_IMAGE_DISPATCH_TARGET (defaulting to triggerdotdev/cloud).

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: making the main-image dispatch repo and ref configurable via variables.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is comprehensive and detailed, exceeding the template requirements with technical justification for design decisions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci-main-image-dispatch-repo-override

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@d-cs d-cs marked this pull request as ready for review June 10, 2026 09:18
@pkg-pr-new

pkg-pr-new Bot commented Jun 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@d4d2619

trigger.dev

npm i https://pkg.pr.new/trigger.dev@d4d2619

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@d4d2619

@trigger.dev/plugins

npm i https://pkg.pr.new/@trigger.dev/plugins@d4d2619

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@d4d2619

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@d4d2619

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@d4d2619

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@d4d2619

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@d4d2619

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@d4d2619

commit: d4d2619

devin-ai-integration[bot]

This comment was marked as resolved.

Addresses review feedback:

- The startsWith(github.ref_name, ...) gate would fire during release builds:
  release.yml invokes publish.yml via workflow_call with an explicit image_tag
  while github.ref_name is still `main`, so the job ran without CROSS_REPO_PAT
  and failed the release pipeline. Gate on github.event_name == 'push' — the
  intended paths (push to main, push of build-* tags) are push events; the
  release path is pull_request/workflow_dispatch. A version-equality check
  can't be used because build-* tags strip the prefix to the version output.
- Make the dispatch target overridable via MAIN_IMAGE_DISPATCH_TARGET,
  defaulting to triggerdotdev/cloud.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@d-cs d-cs merged commit 459dce2 into main Jun 10, 2026
30 checks passed
@d-cs d-cs deleted the ci-main-image-dispatch-repo-override branch June 10, 2026 10:31
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.

2 participants