From 5f8c5131b71d672654faa7cc5810f2450b137cb5 Mon Sep 17 00:00:00 2001 From: "yemyat (github)" Date: Sun, 18 Jan 2026 23:32:59 +0800 Subject: [PATCH] feat: add workflow to create release PR from dev to main --- .github/workflows/create-release-pr.yml | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/create-release-pr.yml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml new file mode 100644 index 0000000..e015faa --- /dev/null +++ b/.github/workflows/create-release-pr.yml @@ -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 <