Use checkout submodules: true #4
Workflow file for this run
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: Update submodules | |
# TODO: Remove push, only using push temporarily while building this workflow | |
on: [push] | |
# Manual workflow: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
#on: workflow_dispatch | |
# TODO: Use schedule below once finalized | |
#on: | |
# schedule: | |
# - cron: '17 8 10 * *' # Run monthly on the 10th, at 8:17am | |
# TODO: | |
# 1. Checkout then create a branch like submodules-update-<timestamp> | |
# 2. Run `git submodule update --remote --merge` to update all git submodules (https://stackoverflow.com/questions/8191299/update-a-submodule-to-the-latest-commit/42175412#42175412) | |
# 3. Commit results | |
# 4. Push branch | |
# 5. Open PR | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set TODAY env var | |
run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Create branch | |
run: git checkout -b submodules-update-$TODAY | |
- name: Run submodule updates | |
run: git submodule update --remote --merge --jobs 4 | |
- name: Commit results | |
run: git commit -m "Update submodules $TODAY" . | |
- name: Push branch | |
run: echo 'TODO' | |
- name: Open pull request | |
run: echo 'TODO' | |
#on: push | |
#jobs: | |
# build: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - run: | | |
# date > generated.txt | |
# git config user.name github-actions | |
# git config user.email [email protected] | |
# git add . | |
# git commit -m "generated" | |
# git push |