Skip to content
Draft
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
36 changes: 36 additions & 0 deletions .github/workflows/release-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release Preview
"on":
pull_request:
types:
- opened
- synchronize
permissions:
contents: read # for checkout
jobs:
release-preview:
permissions:
issues: read # to be able to comment on released issues
pull-requests: read # to be able to comment on released pull requests
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Required by semantic-release
# Use the pull request head ref (source branch) to ensure the dry run simulates a release for the current PR.
# LIMITATION: will probably not work with pull requests from forks forbidding read accesses.
ref: ${{ github.head_ref }}
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: npm
node-version: lts/*
- run: npm ci
# Perform a dry run without publishing anything.
#
# Unset the `GITHUB_ACTIONS` environment variable to trick semantic-release into thinking it's not running in a CI environment,
# as `--no-ci` alone is insufficient.
#
# Use `--branches "${GITHUB_HEAD_REF}"` to consider the PR head ref (source branch) as a release one for the dry run.
- run: |
unset GITHUB_ACTIONS
npx --no-install semantic-release --dry-run --no-ci --branches "${GITHUB_HEAD_REF}"
Loading