sync #472
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: sync | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 */24 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: update submodule | |
id: update-submodule | |
run: | | |
git submodule update --remote | |
echo ::set-output name=commit-status::$(git status --porcelain=v1 2>/dev/null | wc -l) | |
- name: Commit files | |
if: ${{ steps.update-submodule.outputs.commit-status==1 }} | |
id: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions" | |
git add . | |
git commit -m "sync submodule" -a | |
- name: Push changes | |
id: push | |
if: ${{ steps.update-submodule.outputs.commit-status==1 }} | |
uses: ad-m/github-push-action@master | |
with: | |
force_with_lease: true | |