Merge pull request #144 from yige-yigeren/main #2
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
name: Update Git Submodule and Auto-Merge | |
on: | |
schedule: | |
- cron: '0 0 * * 0' | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
sync: | |
name: 'Submodules Sync' | |
runs-on: ubuntu-latest | |
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# Checkout the repository to the GitHub Actions runner | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.CI_TOKEN }} | |
submodules: true | |
# Update references | |
- name: Git Submodule Update | |
run: | | |
git pull --recurse-submodules | |
git submodule update --remote --recursive | |
- name: Commit update | |
run: | | |
git config --global user.name 'Github Action' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git commit -am "Auto updated submodule references" && git push || echo "No changes to commit" |