Skip to content

Commit

Permalink
feat: merge step bump and push
Browse files Browse the repository at this point in the history
  • Loading branch information
khoilen committed Jan 7, 2025
1 parent eff1bba commit f14a94b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,26 @@ jobs:
git config user.name 'khoilen'
git config user.email '[email protected]'
- 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'
Expand Down

0 comments on commit f14a94b

Please sign in to comment.