Repository navigation
fix(core): use zod/v4 for the snapshot route schema so warm starts wo… #762
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🦋 Changesets PR | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "release/**" | |
| paths: | |
| - "packages/**" | |
| - ".changeset/**" | |
| - ".server-changes/**" | |
| - "package.json" | |
| - "pnpm-lock.yaml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| release-pr: | |
| name: Create Release PR | |
| runs-on: warp-ubuntu-latest-x64-2x | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| checks: write | |
| if: github.repository == 'triggerdotdev/trigger.dev' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # zizmor: ignore[artipacked] changesets/action pushes the release branch; no artifact upload here so no leak path | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| - name: Setup node | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24.18.0 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Create release PR | |
| id: changesets | |
| uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0 | |
| with: | |
| version: pnpm run changeset:version | |
| commit: "chore: release" | |
| title: "chore: release" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update PR title and enhance body | |
| if: steps.changesets.outputs.published != 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| SOURCE_BRANCH="${GITHUB_REF_NAME}" | |
| PR_BRANCH="changeset-release/${SOURCE_BRANCH}" | |
| PR_NUMBER=$(gh pr list --head "$PR_BRANCH" --json number --jq '.[0].number') | |
| if [ -n "$PR_NUMBER" ]; then | |
| git fetch origin "+${PR_BRANCH}:refs/remotes/origin/${PR_BRANCH}" | |
| # we arbitrarily reference the version of the cli package here; it is the same for all package releases | |
| VERSION=$(git show "origin/${PR_BRANCH}:packages/cli-v3/package.json" | jq -r '.version') | |
| gh pr edit "$PR_NUMBER" --title "chore: release v$VERSION" | |
| # Enhance the PR body with a clean, deduplicated summary | |
| RAW_BODY=$(gh pr view "$PR_NUMBER" --json body --jq '.body') | |
| ENHANCED_BODY=$(CHANGESET_PR_BODY="$RAW_BODY" node scripts/enhance-release-pr.mjs "$VERSION") | |
| if [ -n "$ENHANCED_BODY" ]; then | |
| gh api repos/triggerdotdev/trigger.dev/pulls/"$PR_NUMBER" \ | |
| -X PATCH \ | |
| -f body="$ENHANCED_BODY" | |
| fi | |
| fi | |
| # The changesets bot authors release PRs with GITHUB_TOKEN, which by GitHub | |
| # design cannot trigger downstream workflows. That leaves the required | |
| # "All PR Checks" status permanently Expected and the PR unmergeable. | |
| # The release PR only bumps package.json + lockfile + CHANGELOGs from | |
| # changesets already on the source branch, so we self-report the required | |
| # check as success. If a human pushes to the generated release branch, the | |
| # real pr_checks.yml result overwrites this one (last write wins for the | |
| # same context on the same SHA). | |
| - name: Self-report "All PR Checks" success on release PR | |
| if: steps.changesets.outputs.published != 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| SOURCE_BRANCH="${GITHUB_REF_NAME}" | |
| PR_BRANCH="changeset-release/${SOURCE_BRANCH}" | |
| PR_NUMBER=$(gh pr list --head "$PR_BRANCH" --json number --jq '.[0].number') | |
| if [ -z "$PR_NUMBER" ]; then exit 0; fi | |
| HEAD_SHA=$(gh pr view "$PR_NUMBER" --json headRefOid --jq '.headRefOid') | |
| gh api -X POST repos/${{ github.repository }}/check-runs \ | |
| -f name="All PR Checks" \ | |
| -f head_sha="$HEAD_SHA" \ | |
| -f status=completed \ | |
| -f conclusion=success \ | |
| -f 'output[title]=Auto-pass for changeset release PR' \ | |
| -f "output[summary]=Required check auto-satisfied for ${PR_BRANCH} PRs. Full CI ran on the underlying commits before they landed on ${SOURCE_BRANCH}." |