From c4aff4e77c3134701afe19c0d3e5411c0e648ae6 Mon Sep 17 00:00:00 2001 From: AntoineGautier Date: Fri, 15 Sep 2023 15:38:33 +0200 Subject: [PATCH] Change username and fix setting on Windows --- .github/workflows/cmake.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d50c01f..f008812 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -10,7 +10,7 @@ on: env: BUILD_TYPE: Release - GH_USERNAME: ${{ github.actor }} + GH_USERNAME: github-actions[bot] jobs: build: @@ -78,8 +78,6 @@ jobs: github.event_name == 'push' && github.ref == 'refs/heads/master' run: | - git config --global user.name $GH_USERNAME - git config --global user.email $GH_USERNAME@users.noreply.github.com git config --global pull.rebase true git add ${{ github.workspace }}/pyfunnel/lib @@ -89,13 +87,19 @@ jobs: contains(matrix.python-version, '3.9') && github.event_name == 'push' && github.ref == 'refs/heads/master' - run: git diff-index --quiet HEAD || { git commit -m "Add ${{ matrix.os }} binaries" && git pull && git push; } + run: | + git config --global user.name "${GH_USERNAME}" + git config --global user.email "${GH_USERNAME}@users.noreply.github.com" + git diff-index --quiet HEAD || { git commit -m "Add ${{ matrix.os }} binaries" && git pull && git push; } + # We use cmd /c because powershell <7 does not support chain operators. - name: Push Windows binaries if: | matrix.os == 'windows-latest' && contains(matrix.python-version, '3.9') && github.event_name == 'push' && github.ref == 'refs/heads/master' - # We use cmd /c because powershell <7 does not support chain operators. - run: cmd /c 'git diff-index --quiet HEAD || ( git commit -m "Add ${{ matrix.os }} binaries" && git pull && git push )' + run: | + git config --global user.name "${{ env.GH_USERNAME }}" + git config --global user.email "${{ env.GH_USERNAME }}@users.noreply.github.com" + cmd /c 'git diff-index --quiet HEAD || ( git commit -m "Add ${{ matrix.os }} binaries" && git pull && git push )'