Skip to content

ci: trigger post-merge publish and deploy on push to main - #178

Open
jaysin586 wants to merge 1 commit into
mainfrom
ci/post-merge-push-triggers
Open

ci: trigger post-merge publish and deploy on push to main#178
jaysin586 wants to merge 1 commit into
mainfrom
ci/post-merge-push-triggers

Conversation

@jaysin586

Copy link
Copy Markdown
Contributor

Mirror of humanspeak/svelte-motion#468 for this repo.

Why

GitHub withholds secrets from pull_request events triggered by fork PRs — including the merged closed event. Our post-merge npm publish and Cloudflare deploy both keyed off pull_request[closed], so external contributions merged to main silently failed to publish/deploy (first hit: humanspeak/svelte-motion#466).

What changed

Push-trigger migration

  • npm-publish.yml and cloudflare-deploy.yml now run on push to main (plus workflow_dispatch), keeping the existing paths: filters. Push events always run in the base repo with secrets.
  • Push payloads carry no PR context, so check-if-merged recovers the merged PR from the commit via listPullRequestsAssociatedWithCommit and exposes has_skip_label / has_major / has_minor / pr_number / pr_title / pr_url as job outputs. Every downstream step now consumes those outputs instead of github.event.pull_request.*; PR-comment steps are guarded on pr_number != ''. Direct pushes to main without an associated merged PR stay unpublished, matching the old behavior.

Action version bumps (all workflows + .trunk/setup-ci/action.yaml)

actions/checkout v6→v7, actions/setup-node v6→v7, actions/cache v5→v6, actions/upload-artifact v4→v7, actions/github-script v7→v9, actions/setup-python v6→v7, crazy-max/ghaction-import-gpg v6→v7.

Trunk unit-test upload hardening

The Vitest results upload to trunk-io/analytics-uploader in npm-publish.yml is now continue-on-error: true — telemetry only, so a flaky upload can never block a release (a "fetch failed" there blocked the svelte-motion v0.9.0 publish on 2026-08-12). vite.config.ts already emits junit-vitest.xml, matching the workflow's junit-paths.

🤖 Generated with Claude Code

- Switch npm-publish.yml and cloudflare-deploy.yml from
  pull_request[closed] to push on main: fork PRs never receive secrets,
  even on the merged close event, so post-merge publishes/deploys
  silently failed for external contributions (first hit:
  humanspeak/svelte-motion#466). check-if-merged now recovers the merged
  PR (labels, title, URL) from the commit via the GitHub API, and all
  downstream steps consume its outputs instead of the pull_request
  payload.
- Bump action versions everywhere: checkout v6->v7, setup-node v6->v7,
  cache v5->v6, upload-artifact v4->v7, github-script v7->v9,
  setup-python v6->v7, ghaction-import-gpg v6->v7.
- Harden the trunk analytics Vitest upload in npm-publish.yml with
  continue-on-error so a flaky telemetry upload can never block a
  release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jaysin586 jaysin586 added bug Apply to any code that fixes incorrect behavior or errors skip-publish This is something important, but we dont want to publish it labels Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ddaf43dc-e795-4289-b29b-1e7dd6ea0d15

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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

Labels

bug Apply to any code that fixes incorrect behavior or errors skip-publish This is something important, but we dont want to publish it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant