From b7c1265f5d5f15cbb54f711b0555e12a46d9fdbd Mon Sep 17 00:00:00 2001 From: FreePhoenix888 Date: Mon, 18 Dec 2023 13:15:17 +0600 Subject: [PATCH] Fix commit and push step --- .github/workflows/os-builds.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/os-builds.yaml b/.github/workflows/os-builds.yaml index 04a96d28..db215358 100644 --- a/.github/workflows/os-builds.yaml +++ b/.github/workflows/os-builds.yaml @@ -34,14 +34,17 @@ jobs: npx --yes bun run ./automation/sync-electron-package-version.ts - name: Commit and push run: | - git config --local user.email "freephoenix888@gmail.com" - git config --local user.name "FreePhoenix888" - git add electron/package.json - git commit -m "Sync electron package version" - if git diff --exit-code; then - echo "No changes to push." + if [[ $(git status -s) ]]; then + # Changes are present + # Stage all changes + git config --local user.email "freephoenix888@gmail.com" + git config --local user.name "FreePhoenix888" + git add electron/package.json + git commit -m "Sync electron package version" + git push origin main else - git push + # No changes in the working directory + echo "No changes in the working directory." fi linux-build: name: Linux Build