From c579edb204eba5356c13ea73377e3df9b13efaa4 Mon Sep 17 00:00:00 2001 From: NSPC911 Date: Tue, 30 Jul 2024 19:58:07 +0800 Subject: [PATCH] [workflow] try with git-aut-commit action workflows are annoying :sob: --- .github/workflows/submodule-update.yml | 33 +++++++++++--------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 152606b..2b3c65c 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -22,23 +22,18 @@ jobs: run: | git submodule update --remote - - name: Check for changes - id: changes - run: | - if [ -n "$(git status --porcelain)" ]; then - echo "changes=true" >> $GITHUB_ENV - else - echo "changes=false" >> $GITHUB_ENV - fi - + - run: echo "Updated submodules" >> commitmessage.txt + - run: echo "Triggered by ${{ github.event.inputs.title }}" >> commitmessage.txt + - run: | + echo 'commit_message<> $GITHUB_OUTPUT + cat commitmessage.txt >> $GITHUB_OUTPUT + echo 'EOF' >> $GITHUB_OUTPUT + - run: rm -rf commitmessage.txt + - name: Commit and push changes - if: env.changes == 'true' - run: | - git config user.name 'NSPBot911' - git config user.email ${{ secrets.BOT_EMAIL }} - git add --all - git commit -m "Updated submodules" -m "Triggered by ${{ github.event.inputs.title }}" - git pull origin main - git push origin main - env: - GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} \ No newline at end of file + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: ${{ steps.commit_message_step.outputs.commit_message }} + commit_user_name: NSPBot911 + commit_user_email: ${{ BOT_EMAIL }} + commit_author: NSPBot911 <${{ BOT_EMAIL }}> \ No newline at end of file