From ab4dd701645d9a20632b1a26f360097f353472de Mon Sep 17 00:00:00 2001 From: "Jun Siang Cheah (aider)" Date: Sun, 1 Sep 2024 22:55:12 +0100 Subject: [PATCH] refactor: Use output instead of exit code to check for diffs in update-readme workflow --- .github/workflows/update-readme.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index 7172a58..62d6e39 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -31,15 +31,16 @@ jobs: - name: Check for changes id: changes run: | - git diff --exit-code + git diff > changes.diff + echo "diff=$(cat changes.diff)" >> $GITHUB_OUTPUT - name: Commit changes - if: steps.changes.outputs.exit_code != '0' + if: steps.changes.outputs.diff != '' uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "Update README with latest models" branch: update-readme-${{ github.run_id }} - name: Create Pull Request - if: steps.changes.outputs.exit_code != '0' + if: steps.changes.outputs.diff != '' uses: peter-evans/create-pull-request@v6 with: title: "Update README with latest models"