-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (40 loc) · 1.16 KB
/
update_submodules.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
40
41
name: Update submodules
run-name: Update submodules
permissions: write-all
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
branches:
- main
jobs:
update_submodules:
name: Update submodules
runs-on: ubuntu-latest
env:
TZ: "Asia/Tokyo"
if: contains(github.event.head_commit.message, '[ci skip]') == false
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Update submodules
id: update
run: git submodule update --remote --recursive
- name: Run git status
id: status
run: echo "::set-output name=status::$(git status -s)"
- name: Add and commit files
run: |
git add .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update submodules at $(date "+DATE: %Y-%m-%d TIME: %H:%M:%S")"
if: ${{ steps.status.outputs.status }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
if: ${{ steps.status.outputs.status && github.event_name == 'push' }}