Skip to content

chore(workflow): pin workflow to Node24 so that we can use trusted pu… #551

chore(workflow): pin workflow to Node24 so that we can use trusted pu…

chore(workflow): pin workflow to Node24 so that we can use trusted pu… #551

Workflow file for this run

name: Publish
on:
push:
branches:
- main
pull_request:
env:
TURBO_TOKEN: ${{ secrets.TURBOREPO_REMOTE_CACHING_TOKEN }}
TURBO_TEAM: vercel
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"
- run: pnpm install
shell: bash
- name: Build Monorepo
run: pnpm run build
- name: Run tests
run: pnpm test
- name: Create Release Pull Request
uses: changesets/action@v1
if: github.ref == 'refs/heads/main'
id: changesets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: pnpm version:prepare
publish: pnpm release
commitMode: github-api
- name: Trigger Vercel CLI Sandbox Sync
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v7
env:
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
with:
github-token: ${{ secrets.VERCEL_CLI_RELEASE_BOT_TOKEN }}
script: |
const publishedPackages = JSON.parse(
process.env.PUBLISHED_PACKAGES || '[]'
);
const sandboxPackage = publishedPackages.find(
pkg => pkg.name === 'sandbox'
);
if (!sandboxPackage) {
console.log('sandbox was not published, skipping CLI sync.');
return;
}
await github.rest.actions.createWorkflowDispatch({
owner: 'vercel',
repo: 'vercel',
workflow_id: 'update-sandbox.yml',
ref: 'main',
inputs: {
version: sandboxPackage.version,
source_repository: `${context.repo.owner}/${context.repo.repo}`,
source_run_id: String(context.runId),
},
});