diff --git a/.github/workflows/gen-configs.yaml b/.github/workflows/gen-configs.yaml index 2d6508b150..1984777ad9 100644 --- a/.github/workflows/gen-configs.yaml +++ b/.github/workflows/gen-configs.yaml @@ -36,7 +36,15 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub build-firmware Action" git status - git commit -am "Auto-generated configs and docs" 2>&1 | grep -E '(nothing to commit|changed)' + OUT=$(git commit -am "Auto-generated configs and docs" 2>&1) || echo "commit failed, finding out why" + if echo "$OUT" | grep 'nothing to commit'; then + echo "::set-env name=NOCOMMIT::true" + exit 0 + elif echo "$OUT" | grep 'changed'; then + exit 0 + else + exit 1 + fi # We need to know what branch this is in order to push to the correct branch - name: Extract branch name @@ -45,6 +53,7 @@ jobs: id: extract_branch - name: Push configs + if: ${{env.NOCOMMIT != 'true'"}} uses: ad-m/github-push-action@master with: github_token: ${{ github.token }}