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
58 changes: 58 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Create Release PR

on:
workflow_dispatch:
inputs:
title:
description: "Release title (optional)"
required: false
default: ""

jobs:
create-release-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get version from package.json
id: version
run: echo "current=$(jq -r .version package.json)" >> $GITHUB_OUTPUT

- name: Generate changelog preview
id: changelog
run: |
echo "## Changes since last release" > /tmp/changelog.md
echo "" >> /tmp/changelog.md
git log main..dev --pretty=format:"- %s" >> /tmp/changelog.md || echo "- No new commits" >> /tmp/changelog.md

- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TITLE="${{ github.event.inputs.title }}"
if [ -z "$TITLE" ]; then
TITLE="Release: dev → main"
fi

BODY=$(cat <<EOF
## Release PR

Merging \`dev\` into \`main\` will trigger semantic-release to:
- Analyze commits and determine version bump
- Update CHANGELOG.md
- Publish to npm
- Create GitHub release

**Current version:** ${{ steps.version.outputs.current }}

$(cat /tmp/changelog.md)
EOF
)

gh pr create \
--base main \
--head dev \
--title "$TITLE" \
--body "$BODY"