-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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." |