Skip to content

Update submodules

Update submodules #720

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' }}