From b72825bf5c03a935440f447352e436c9780ab6ea Mon Sep 17 00:00:00 2001 From: Rami Maalouf Date: Sun, 2 Jun 2024 22:03:09 -0400 Subject: [PATCH] handle the case where there is no changes --- .github/workflows/deploy.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0d6001188..373909e54 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -33,8 +33,12 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add . - git commit -m "Update submodule via GitHub Action" - git push origin main + if git diff-index --quiet HEAD --; then + echo "No changes to commit" + else + git commit -m "Update submodule via GitHub Action" + git push origin main +fi - uses: actions/setup-node@v3 with: node-version: 18.14