Skip to content

Commit

Permalink
fix automatic submodule updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosalm committed Feb 3, 2025
1 parent fa97652 commit c3e1139
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/update_submodules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,37 @@ on:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.PAT }}
fetch-depth: 0

- name: Update submodules
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# update submodules
git submodule update --remote --recursive
# check if there are changes
if git diff --cached --quiet && git diff --quiet; then
echo "No updates found in submodules"
exit 0
fi
# commit and push changes
git add .
git diff --cached --quiet || git commit -m "action: update submodules"
git commit -m "update submodules [skip ci]"
git push
- name: Check for errors
if: failure()
run: |
echo "::error::Failed to update submodules. Please check the logs above for details."

0 comments on commit c3e1139

Please sign in to comment.