ci: setup PR-driven release - #23116
Draft
sapphi-red wants to merge 1 commit into
Draft
Conversation
sapphi-red
force-pushed
the
ci/setup-pr-driven-release
branch
from
July 31, 2026 08:25
2f0d172 to
1754366
Compare
bluwy
reviewed
Aug 1, 2026
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" |
Member
There was a problem hiding this comment.
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setup the PR-driven release for like the plugin-react repo does.
needs vitejs/release-scripts#120