From b7a240bbb946aeb5e9662fda550c5ef4192d160c Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Fri, 12 Jul 2024 17:46:04 +0100 Subject: [PATCH] Early out of flake update if there are no changes (#192) --- .github/workflows/commit.py | 2 ++ .github/workflows/flake_update.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/commit.py b/.github/workflows/commit.py index 4489787..045cda0 100755 --- a/.github/workflows/commit.py +++ b/.github/workflows/commit.py @@ -122,6 +122,8 @@ def create_pull_request(title: str, branch_name: str, base_branch: str) -> tuple def main(): changed_files = get_git_diff() + if not changed_files: + return # Create blobs and prepare tree changes tree_changes = [] diff --git a/.github/workflows/flake_update.yaml b/.github/workflows/flake_update.yaml index 90f2ea2..6b0c234 100644 --- a/.github/workflows/flake_update.yaml +++ b/.github/workflows/flake_update.yaml @@ -52,6 +52,7 @@ jobs: run: /tmp/venv/bin/python .github/workflows/commit.py - name: Enable Pull Request Automerge + if: ${{ steps.cpr.outputs.pull-request-number }} uses: peter-evans/enable-pull-request-automerge@v3 with: token: ${{ steps.generate-token.outputs.token }}