Sync OpenClash_Overwrite Submodule #7
This file contains hidden or 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: Sync OpenClash_Overwrite Submodule | |
| on: | |
| schedule: | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync-submodule: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Update submodule | |
| run: | | |
| git -C overwrite/OpenClash_Overwrite fetch origin main | |
| git -C overwrite/OpenClash_Overwrite checkout -B main origin/main | |
| - name: Commit and push if needed | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add overwrite/OpenClash_Overwrite | |
| git commit -m "chore(overwrite): bump OpenClash_Overwrite submodule" | |
| git push origin HEAD:main | |
| else | |
| echo "No changes to commit." | |
| fi |