-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Showing
1 changed file
with
13 additions
and
2 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 |
---|---|---|
|
@@ -43,11 +43,22 @@ jobs: | |
jq ".version = \"${{ steps.get_version.outputs.version }}\"" package.json > tmp.json | ||
mv tmp.json package.json | ||
- name: Commit version change | ||
- name: Check if there are changes to commit | ||
id: check_changes | ||
run: | | ||
git add package.json | ||
if git diff-index --quiet HEAD --; then | ||
echo "No changes to commit." | ||
echo "::set-output name=changes::false" | ||
else | ||
echo "::set-output name=changes::true" | ||
fi | ||
- name: Commit version change to main | ||
if: steps.check_changes.outputs.changes == 'true' | ||
run: | | ||
git config --local user.name "GitHub Actions" | ||
git config --local user.email "[email protected]" | ||
git add package.json | ||
git commit -m "Update version to ${{ steps.get_version.outputs.version }}" | ||
git push origin HEAD:main | ||
|