Skip to content

Commit

Permalink
[workflow] try with git-aut-commit action
Browse files Browse the repository at this point in the history
workflows are annoying 😭
  • Loading branch information
NSPC911 committed Jul 30, 2024
1 parent 2553986 commit c579edb
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions .github/workflows/submodule-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF' >> $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 }}
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 }}>

0 comments on commit c579edb

Please sign in to comment.