From f14a94b1b101f5588b342a4655aa0c4fd0c52109 Mon Sep 17 00:00:00 2001 From: khoilen Date: Tue, 7 Jan 2025 12:38:04 +0700 Subject: [PATCH] feat: merge step bump and push --- .github/workflows/bump-version.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index ebee3a1..47d9604 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -41,30 +41,26 @@ jobs: git config user.name 'khoilen' git config user.email 'khoilen@nastechglobal.com' - - name: bump version + - name: Bump version and push to local branch id: bump-version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | pnpm version ${{ github.event.inputs.version }} || true version=$(jq -r '.version' ./package.json) echo "Bumped version: $version" echo "new_version=$version" >> $GITHUB_ENV - working-directory: apps/nt-stylesheet - continue-on-error: true - - - name: Push latest version - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - if [ "${{ env.new_version }}" != "unknown" ]; then + if [ "${{ env.new_version }}" != "unknown" ]; then git checkout -b bump-version-${{ env.new_version }} git add . git commit -m "Bump version to ${{ env.new_version }}" git tag "v${{ env.new_version }}" git push origin bump-version-${{ env.new_version }} --follow-tags - else + else echo "Skipping push due to unknown version" - fi + fi working-directory: apps/nt-stylesheet + continue-on-error: true - name: Create Pull Request if: env.new_version != 'unknown'