Skip to content

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

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#191
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.

Why

GitHub withholds repository secrets from pull_request events triggered by fork PRs — including the merged closed event. Since npm-publish and cloudflare-deploy triggered on pull_request[closed], publishes and deploys silently failed whenever an external contribution merged (first hit: svelte-motion PR #466).

What changed

Push-trigger migration

  • npm-publish.yml and cloudflare-deploy.yml now trigger on push to main (existing paths: filters and workflow_dispatch kept). 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 (github-script@v9) and exposes has_skip_label / has_major / has_minor / pr_number / pr_title / pr_url outputs. Every downstream github.event.pull_request.* reference now reads those outputs; PR-comment steps are guarded on pr_number != ''.
  • Direct pushes to main without an associated merged PR do not publish — same behavior as the old trigger. The version-bump commit is [skip ci], so it cannot retrigger the workflow.

Action version bumps

  • actions/setup-python v6 → v7, actions/stale v10 → v11. (checkout/setup-node/cache/upload-artifact/github-script/codeql/import-gpg were already current in this repo.)

Trunk unit-test upload hardening

  • Added Upload Vitest Results (junit-vitest.xml) to the build job and Upload Playwright Results (test-results/junit-playwright.xml) to the playwright job in npm-publish.yml, both trunk-io/analytics-uploader@main with if: always() and continue-on-error: true — telemetry only, a flaky upload must never block a release.
  • playwright.config.ts now writes its junit report to test-results/junit-playwright.xml so the uploader and the existing playwright-results artifact both find it. Vitest already emitted junit-vitest.xml via vite.config.ts.

Note: these uploads rely on TRUNK_ORG_SLUG / TRUNK_TOKEN secrets being present in the ci environment — worth double-checking before merge.

🤖 Generated with Claude Code

- npm-publish.yml and cloudflare-deploy.yml now trigger on push to main
  instead of pull_request[closed]: GitHub withholds secrets from
  pull_request events raised by fork PRs — even the merged close event —
  so publishes and deploys silently failed for external contributions
  (mirror of humanspeak/svelte-motion#468). PR context (labels, title,
  URL) is recovered via listPullRequestsAssociatedWithCommit in
  check-if-merged, and all downstream github.event.pull_request.*
  references now read the recovered outputs.
- Bump remaining action versions: actions/setup-python v6→v7,
  actions/stale v10→v11 (checkout, setup-node, cache, upload-artifact,
  github-script, codeql, import-gpg were already current here).
- Harden trunk analytics: add Upload Vitest Results and Upload
  Playwright Results steps (trunk-io/analytics-uploader, telemetry-only
  with continue-on-error) to npm-publish.yml, and move the playwright
  junit report into test-results/junit-playwright.xml so the uploader
  and the playwright-results artifact both find it.

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: ASSERTIVE

Plan: Pro

Run ID: 895cf503-c5be-4cc6-8ebc-9d7d3695158d

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