Skip to content

Update submodules

Update submodules #29

name: Update submodules
on:
schedule:
- cron: '17 8 10 * *' # Run monthly on the 10th, at 8:17am
workflow_dispatch: # Can be run manually from GitHub UI
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write # Permit git push
pull-requests: write
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 --checkout
- name: Configure git user
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Commit
run: |
git add .
git commit -m "Update submodules $TODAY"
- name: Push branch
run: |
git config push.autoSetupRemote true
git push
- name: Open pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create \
--fill \
--reviewer eliotsykes \
--base ${{ github.ref_name }}