forked from dss16694/WechatFp
-
Notifications
You must be signed in to change notification settings - Fork 128
39 lines (34 loc) · 1.13 KB
/
submodule.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: 'Submodules Sync'
on:
push:
branches:
- main
schedule:
- cron: '1 18 * * *'
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
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
token: ${{ secrets.TOKEN_GITHUB }}
# Update references
- name: Git Sumbodule Update
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
run: |
git config --global user.name 'Git bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.TOKEN_GITHUB }}@github.com/${{ github.repository }}
[[ -z $(git status -s) ]] || git commit -am "$(git submodule summary -n -1)" && git push || echo "No changes to commit"