From f75a7621a5604aeae00ffa57a547fd307c151ff0 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Wed, 15 Mar 2023 17:21:32 +0000 Subject: [PATCH] sorbet: Fix (not) committing Spoom automatic sigil bumps - This was failing to push the existing changes if there was nothing to commit. Add an extra `if`. ``` ==> Bumping Sorbet `typed` sigils... Checking files... No file to bump from false to true Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) [sorbet-files-update 7c3c04e94] sorbet: Update RBI files. 1 file changed, 5 insertions(+), 1 deletion(-) On branch sorbet-files-update nothing to commit, working tree clean Error: Process completed with exit code 1. ``` --- .github/workflows/sorbet.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sorbet.yml b/.github/workflows/sorbet.yml index 25bb875178..d5a42c3792 100644 --- a/.github/workflows/sorbet.yml +++ b/.github/workflows/sorbet.yml @@ -59,9 +59,12 @@ jobs: git commit -m "sorbet: Update RBI files." \ -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow." - git add "Library/Homebrew/" - git commit -m "sorbet: Autobump sigils via Spoom" \ - -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow." + if ! git diff --stat --exit-code "Library/Homebrew" + then + git add "Library/Homebrew/" + git commit -m "sorbet: Autobump sigils via Spoom" \ + -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow." + fi echo "committed=true" >> $GITHUB_OUTPUT PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state")"