From 7b94e3828961951fcc1eff1b51b22bd6eb759d45 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 28 May 2024 08:56:26 +0200 Subject: [PATCH] Add a check whether there are actual changes to commit --- .github/workflows/generate.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index d47a83a..c223ffb 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -114,9 +114,17 @@ jobs: if: ${{ github.event.inputs.update == 'true' || inputs.update == true }} working-directory: app/data run: | + # Check for any differences between the working directory and the latest commit + if git diff --quiet; then + echo "No changes to commit" + exit 0 + fi + + # Configure git git config user.email "administrator@faforever.com" git config user.name "FAForever" + # Add and commit the changes git stage . git commit -m 'Update generated data to game version ${{ fromJson(steps.gameVersionJSON.outputs.json).version }} @@ -124,6 +132,8 @@ jobs: Commit hash of Nomads repository: ${{ steps.hashNomads.outputs.hash }}' git log + + # git push origin HEAD:master # git tag "${{ fromJson(steps.gameVersionJSON.outputs.json).version}}"