From 31828f09d6b013ea05261843e5ef2433095e00c7 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Fri, 5 Apr 2024 00:44:50 +0200 Subject: [PATCH] Publishing: Only push antora.yml if it's changed We don't change the file on patch releases. --- .github/workflows/publish.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 40e7c6ba7..8b49bb0ae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,12 +25,14 @@ jobs: bundle exec rake create_release_notes gh release create $(git tag --points-at @) \ --title "RuboCop RSpec $(git tag --points-at @)" \ - --notes-file relnotes.md \ + --notes-file relnotes.md - name: Replace version in Antora config run: | sed -i 's/version:.*$/version: ~/' docs/antora.yml - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git add docs/antora.yml - git commit -m "Switch docs version back" - git push + if ! git diff --exit-code docs/antora.yml; then + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + git add docs/antora.yml + git commit -m "Switch docs version back" + git push + fi