Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add submodule pin check to CI #2455

Merged
merged 15 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/submodule-pin-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

declare -Ar exceptions=(
[contracts]=origin/develop
[nitro-testnode]=origin/master

#TODO Rachel to check these are the intended branches.
[arbitrator/langs/c]=origin/vm-storage-cache
[arbitrator/tools/wasmer]=origin/adopt-v4.2.8
)

divergent=0
for mod in `git submodule --quiet foreach 'echo $name'`; do
branch=origin/HEAD
if [[ -v exceptions[$mod] ]]; then
branch=${exceptions[$mod]}
fi

if ! git -C $mod merge-base --is-ancestor HEAD $branch; then
echo $mod diverges from $branch
divergent=1
fi
done

exit $divergent

21 changes: 21 additions & 0 deletions .github/workflows/submodule-pin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Submodule Pin Check

on:
pull_request:
branches: [ master ]
types: [synchronize, opened, reopened]

jobs:
submodule-pin-check:
name: Submodule Pin Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Check all submodules are ancestors of origin/HEAD or configured branch
run: ${{ github.workspace }}/.github/workflows/submodule-pin-check.sh

2 changes: 1 addition & 1 deletion arbitrator/langs/bf
Submodule bf updated 1 files
+2 −2 README.md
Loading