-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a584f5
commit f648677
Showing
1 changed file
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ jobs: | |
update-cli-version: | ||
if: "${{contains(github.event.head_commit.message, 'chore(main): release')}}" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_version: ${{ steps.create_branch.outputs.new_version }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
@@ -17,6 +19,7 @@ jobs: | |
ROOT_VERSION=$(jq -r '.version' package.json) | ||
NEW_BRANCH="npm-pull-request-of-v${ROOT_VERSION}" | ||
echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV | ||
echo "::set-output name=new_version::$ROOT_VERSION" | ||
git checkout -b $NEW_BRANCH | ||
- name: Update CLI package.json | ||
|
@@ -25,18 +28,18 @@ jobs: | |
jq ".version = \"$ROOT_VERSION\"" packages/cli/package.json > temp.json && mv temp.json packages/cli/package.json | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "github-actions[bot]" | ||
git add packages/cli/package.json | ||
git add . | ||
git commit -m "chore(cli): sync package version to cli" | ||
git push --set-upstream origin ${{ env.NEW_BRANCH }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "chore(cli): release npm version of ${{steps.set_version.outputs.version}}" | ||
title: "Publish npm v${{ steps.set_version.outputs.version }}" | ||
body: "Update npm package version to ${{ steps.set_version.outputs.version }}" | ||
branch: "npm-pull-request-of-v${{ steps.set_version.outputs.version }}" | ||
commit-message: "chore(cli): release npm version of ${{ steps.create_branch.outputs.new_version }}" | ||
title: "Publish npm v${{ steps.create_branch.outputs.new_version }}" | ||
body: "Update npm package version to ${{ steps.create_branch.outputs.new_version }}" | ||
branch: "npm-pull-request-of-v${{ steps.create_branch.outputs.new_version }}" | ||
base: main | ||
labels: release | ||
id: cpr | ||
|