3d418a9482
Adds zizmor alongside the actionlint job from #3503. Both now run as parallel jobs in a single `.github/workflows/workflow-checks.yml`, triggered on `.github/workflows/**` and `.github/actions/**` changes. Zizmor is configured with `unpinned-uses: hash-pin` policy via `.github/zizmor.yml`, so any future unpinned action will fail CI. Findings upload SARIF to the Security tab alongside CodeQL. Bulk of the diff is cleanup of the findings zizmor surfaced on first run. `zizmor --fix=all` handled most of them mechanically; the rest were judgment calls.
75 lines
2.5 KiB
YAML
75 lines
2.5 KiB
YAML
name: 🦋 Changesets PR
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
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: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
if: github.repository == 'triggerdotdev/trigger.dev'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 # 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@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 20.20.0
|
|
cache: "pnpm"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Create release PR
|
|
id: changesets
|
|
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.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: |
|
|
PR_NUMBER=$(gh pr list --head changeset-release/main --json number --jq '.[0].number')
|
|
if [ -n "$PR_NUMBER" ]; then
|
|
git fetch origin changeset-release/main
|
|
# we arbitrarily reference the version of the cli package here; it is the same for all package releases
|
|
VERSION=$(git show origin/changeset-release/main: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
|