Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
- release
- prerelease
default: "prerelease"
prerelease_ref:
description: "The ref (branch, tag, or SHA) to checkout and release from (prerelease only)"
required: false
ref:
description: "The ref (branch, tag, or SHA) to checkout and release from"
required: true
type: string
prerelease_tag:
description: "The npm dist-tag for the prerelease (e.g., 'v4-prerelease')"
Expand All @@ -30,7 +30,22 @@
cancel-in-progress: false

jobs:
show-release-summary:
name: 📋 Release Summary
runs-on: ubuntu-latest
if: |
github.repository == 'triggerdotdev/trigger.dev' &&
github.event_name == 'pull_request' &&
github.event.pull_request.merged == true &&
github.event.pull_request.head.ref == 'changeset-release/main'
steps:
- name: Show release summary
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
echo "$PR_BODY" | sed -n '/^# Releases/,$p' >> $GITHUB_STEP_SUMMARY

release:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: 🚀 Release npm packages
runs-on: ubuntu-latest
environment: npm-publish
Expand All @@ -53,7 +68,15 @@
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.sha }}

- name: Verify ref is on main
if: github.event_name == 'workflow_dispatch'
run: |
if ! git merge-base --is-ancestor ${{ github.event.inputs.ref }} origin/main; then
echo "Error: ref must be an ancestor of main (i.e., already merged)"
exit 1
fi

- name: Setup pnpm
uses: pnpm/action-setup@v4
Expand Down Expand Up @@ -121,14 +144,7 @@
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.prerelease_ref }}

- name: Validate ref is on main
run: |
if ! git merge-base --is-ancestor ${{ github.event.inputs.prerelease_ref }} origin/main; then
echo "Error: ref must be an ancestor of main (i.e., already merged)"
exit 1
fi
ref: ${{ github.event.inputs.ref }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
Expand Down