Skip to content
Snippets Groups Projects
Unverified Commit eafee4da authored by Brent Huisman's avatar Brent Huisman Committed by GitHub
Browse files

Monthly cron job checking for submodule updates (#1741)

* Create a script that generates `diff.log` if git submodules have tags more recent that the commit they're currently at.
* A Github Action runs this script monthly.
* _If_ updates found, Github Action creates an Issue like so: https://github.com/brenthuisman/arbor/issues/9
* Actually updating the git submodule and Spack file are still manual

First step in addressing #1731
parent 6c489892
No related branches found
No related tags found
No related merge requests found
name: Update submodules
on:
schedule:
# - cron: '0 2 * * 0' # run at 2 AM every sunday
- cron: '5 4 2 * *' # 04:05 every 2nd of month
push:
branches: [ 'ci/auto-update-submodules' ]
jobs:
update_submodules:
runs-on: ubuntu-latest
steps:
- name: Clone w/ submodules
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Check submodules for updates
run: scripts/submodule-diff.sh
- name: Create Issue From File
uses: peter-evans/create-issue-from-file@v3
with:
title: '[AUTOMATED] Git submodule updates found'
content-filepath: ./diff.log
labels: |
dependency update
assignees: brenthuisman
[submodule "google-benchmark"]
path = ext/google-benchmark
url = https://github.com/google/benchmark
branch = main
[submodule "python/pybind11"]
path = python/pybind11
url = https://github.com/pybind/pybind11.git
branch = master
[submodule "ext/fmt"]
path = ext/fmt
url = https://github.com/fmtlib/fmt.git
branch = master
#!/usr/bin/env bash
# Check any git submodule remotes for updates, and print difference with current Arbor repo state to `diff.log`
git submodule foreach 'git describe HEAD --tags' | tee current_state_of_git_submodules_in_arbor_repo.log
git submodule foreach 'git fetch'
git submodule foreach 'git describe `git log --branches -1 --pretty=format:"%H"` --tags --abbrev=0' | tee upstream_state_of_git_submodules.log
if diff current_state_of_git_submodules_in_arbor_repo.log upstream_state_of_git_submodules.log ; then
echo "No submodule updates found"
else
diff current_state_of_git_submodules_in_arbor_repo.log upstream_state_of_git_submodules.log -U 10000 > diff.log
fi
rm current_state_of_git_submodules_in_arbor_repo.log
rm upstream_state_of_git_submodules.log
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment