Skip to content

update submodules

update submodules #47

# This is a basic workflow to help you get started with Actions
name: update submodules
# Controls when the workflow will run
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches: ["main"]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
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 represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo "updating submodules"
- name : setup git info
run: |
git config --global user.name "Git bot"
git config --global user.email "bot@noreply.github.com"
# Update references
- name: fetch submodules references
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
# push submodules
- name: update submodules
run: |
git commit -am "Test: updating submodules" || exit 0
git push && echo "it worked" || echo "No changes to commit"