refactor: Use output instead of exit code to check for diffs in update-readme workflow

This commit is contained in:
Jun Siang Cheah (aider) committed 2024-09-01 22:55:12 +01:00
1 parent 774955fe05
commit ab4dd70164
1 file changed
+4 -3
+4 -3
View File
@@ -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"