Skip to content

Commit

Permalink
chore: Update GitHub Actions workflow to include conditional commit a…
Browse files Browse the repository at this point in the history
…nd push
  • Loading branch information
kylewelsby committed Jun 28, 2024
1 parent bfbb931 commit 8deef42
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,14 @@ jobs:
sed -i "s/VERSION = .*/VERSION = \"${{ github.event.inputs.version }}\"/" lib/name_formatter/version.rb
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add lib/name_formatter/version.rb
git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push
if [[ -n $(git status -s) ]]; then
echo "Changes detected. Committing and pushing..."
git add lib/name_formatter/version.rb
git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push
else
echo "No changes detected. Version is already up-to-date."
fi
- name: Verify gem version 🤝
run: |
version=$(ruby -r ./lib/name_formatter/version.rb -e "puts NameFormatterModule::VERSION")
Expand Down

0 comments on commit 8deef42

Please sign in to comment.