From 57e35f26f50e2419237128aa4af555ad1c372fac Mon Sep 17 00:00:00 2001 From: Raffi Date: Mon, 27 May 2024 18:22:53 +0200 Subject: [PATCH] commit CHANGELOG changes safely --- .github/workflows/bump-and-release.yml | 5 +---- commit_changelog.sh | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 commit_changelog.sh diff --git a/.github/workflows/bump-and-release.yml b/.github/workflows/bump-and-release.yml index 14fb8fb..7cb1aa9 100644 --- a/.github/workflows/bump-and-release.yml +++ b/.github/workflows/bump-and-release.yml @@ -58,10 +58,7 @@ jobs: run: sh update_changelog.sh -v ${{ inputs.version }} - name: Commit and push the changes made to the CHANGELOG.md file if: inputs.version != '' && inputs.dryRun == false - run: | - git add CHANGELOG.md - git commit -m "update CHANGELOG.md" - git push + run: sh commit_changelog.sh - name: Add and push new git tag if: inputs.version != '' run: | diff --git a/commit_changelog.sh b/commit_changelog.sh new file mode 100644 index 0000000..1c7bdf5 --- /dev/null +++ b/commit_changelog.sh @@ -0,0 +1,5 @@ +if ! git diff --quiet CHANGELOG.md; then + git add CHANGELOG.md + git commit -m "update CHANGELOG.md" + git push +fi