WORKFLOW: added proper push step if in gtihub runner [skip ci]

This commit is contained in:
XargonWan 2025-02-03 10:40:29 +09:00
parent c6becfef52
commit 2e74c16c01
2 changed files with 17 additions and 7 deletions

View file

@ -21,4 +21,13 @@ jobs:
env: env:
GIT_NAME: ${{ secrets.GITNAME }} GIT_NAME: ${{ secrets.GITNAME }}
GIT_MAIL: ${{ secrets.GITMAIL }} 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 }}

View file

@ -80,9 +80,10 @@ elif [[ -z $(git config --get user.name) || -z $(git config --get user.email) ]]
fi fi
if [ -n "${GITHUB_WORKFLOW}" ]; then if [ -n "${GITHUB_WORKFLOW}" ]; then
secret="$GIT_TOKEN@" 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 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"