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.
```
This commit is contained in:
Issy Long 2023-03-15 17:21:32 +00:00
parent 5a0cdaa749
commit f75a7621a5
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -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")"