Skip to content

ci: setup PR-driven release - #23116

Draft
sapphi-red wants to merge 1 commit into
mainfrom
ci/setup-pr-driven-release
Draft

ci: setup PR-driven release#23116
sapphi-red wants to merge 1 commit into
mainfrom
ci/setup-pr-driven-release

Conversation

@sapphi-red

@sapphi-red sapphi-red commented Jul 31, 2026

Copy link
Copy Markdown
Member

Setup the PR-driven release for like the plugin-react repo does.

needs vitejs/release-scripts#120

Comment on lines +76 to +115
- id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.RELEASE_GITHUB_APP_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_GITHUB_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}
permission-contents: write
permission-pull-requests: write

- name: Open release PR
env:
APP_SLUG: ${{ steps.generate-token.outputs.app-slug }}
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
PACKAGE: ${{ inputs.package }}
PR_BODY_FILE: ${{ runner.temp }}/release-pr-body.md
TAG: ${{ steps.prepare.outputs.tag }}
VERSION: ${{ steps.prepare.outputs.version }}
run: |
BRANCH="release-$PACKAGE-$VERSION-$GITHUB_RUN_ID"
BOT_ID="$(gh api "/users/$APP_SLUG%5Bbot%5D" --jq .id)"
{
echo "$PACKAGE release PR generated by the Prepare Release workflow: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
echo
echo "## Changelog"
echo
node scripts/extract-changelog.ts "packages/$PACKAGE/CHANGELOG.md" "$VERSION"
} > "$PR_BODY_FILE"
git config user.name "$APP_SLUG[bot]"
git config user.email "$BOT_ID+$APP_SLUG[bot]@users.noreply.github.com"
git switch -c "$BRANCH"
git add "packages/$PACKAGE"
git commit -m "release: $TAG"
git push -u "https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD
gh pr create \
--assignee "$GITHUB_ACTOR" \
--base main \
--head "$BRANCH" \
--title "release: $TAG" \
--body-file "$PR_BODY_FILE"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still look a bit involved I think. Is it worth extracting this out to a shared repo (release-scripts), like https://github.com/bombshell-dev/automation/tree/main/.github/workflows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants