From c66eed5e8512337785e5b7543e4dd76e62c539a1 Mon Sep 17 00:00:00 2001 From: "Jun Siang Cheah (aider)" Date: Sun, 1 Sep 2024 23:34:15 +0100 Subject: [PATCH] refactor: Simplify workflow by leveraging stefanzweifel/git-auto-commit-action@v5 features --- .github/workflows/update-readme.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index 5bab770..525d903 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -36,20 +36,13 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }} run: | python src/pull_available_models.py - - name: Check for changes - id: changes - run: | - git status --porcelain > changes.diff - echo "diff_count=$(cat changes.diff | wc -l)" >> $GITHUB_OUTPUT - - name: Create branch - if: steps.changes.outputs.diff_count != '0' - run: git checkout -b update-readme-${{ github.run_id }} - name: Commit changes - if: steps.changes.outputs.diff_count != '0' + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "Update README with latest models" branch: update-readme-${{ github.run_id }} + create_branch: true - name: Create Pull Request if: steps.changes.outputs.diff_count != '0' uses: peter-evans/create-pull-request@v6