From 2e74c16c014090998b83195ce35828f14b035516 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 3 Feb 2025 10:40:29 +0900 Subject: [PATCH] WORKFLOW: added proper push step if in gtihub runner [skip ci] --- .github/workflows/flathub_push_main.yml | 11 ++++++++++- automation_tools/flathub_push_main.sh | 13 +++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/flathub_push_main.yml b/.github/workflows/flathub_push_main.yml index b4431b15..0e92a3bd 100644 --- a/.github/workflows/flathub_push_main.yml +++ b/.github/workflows/flathub_push_main.yml @@ -21,4 +21,13 @@ jobs: env: GIT_NAME: ${{ secrets.GITNAME }} GIT_MAIL: ${{ secrets.GITMAIL }} - GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Commit and push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Updated flathub/net.retrodeck.retrodeck to v${{ env.RELNAME }} from RetroDECK/${{ env.RD_BRANCH }}" + branch: "${{ env.RD_BRANCH }}" + repository: "${{ secrets.GITHUB_REPOSITORY }}" + commit_user_name: ${{ secrets.GITNAME }} + commit_user_email: ${{ secrets.GITMAIL }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/automation_tools/flathub_push_main.sh b/automation_tools/flathub_push_main.sh index 682f65cf..8cb20142 100755 --- a/automation_tools/flathub_push_main.sh +++ b/automation_tools/flathub_push_main.sh @@ -80,9 +80,10 @@ elif [[ -z $(git config --get user.name) || -z $(git config --get user.email) ]] fi if [ -n "${GITHUB_WORKFLOW}" ]; then - secret="$GIT_TOKEN@" -fi - -git add * -git commit -m "Updated flathub/net.retrodeck.retrodeck to v$relname from RetroDECK/$rd_branch" -git push --force "https://${secret}github.com/${flathub_target_repo}.git" "$relname" \ No newline at end of file + echo "RD_BRANCH=$rd_branch" >> $GITHUB_ENV + echo "RELNAME=$relname" >> $GITHUB_ENV +else + git add . + git commit -m "Updated flathub/net.retrodeck.retrodeck to v$relname from RetroDECK/$rd_branch" + git push --force "https://github.com/${flathub_target_repo}.git" "$relname" +fi \ No newline at end of file