Skip to content

Commit 64acdb8

Browse files
committed
Add comments to submodule check
1 parent 980027b commit 64acdb8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/workflows/submodule-check.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ jobs:
1818
with:
1919
submodules: true
2020

21-
- name: Check submodules
21+
- # Only PRs where all the submodules are on the main branch of their respective repositories
22+
# are allowed to merge to main.
23+
#
24+
# The script can be run locally to confirm that the submodules are on the main branch.
25+
#
26+
# Note, the main branch of submodule repositories have a name other than "main".
27+
# For example: "master" or "develop".
28+
name: Check submodules
2229
env:
2330
GH_TOKEN: ${{ github.token }}
2431
run: ./scripts/ci/require-submodules-on-main-branch.sh

scripts/ci/require-submodules-on-main-branch.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env bash
2+
#
3+
# This script checks that all submodules are on the main branch when the main branch of the repository is main.
4+
#
5+
# The script exits with a non-zero exit code if any submodules are not on the main branch.
26

7+
# TODO: Use this initialisation of main_branch once the repository is made public
38
# main_branch=$(gh repo view --json defaultBranchRef | jq -r .defaultBranchRef.name)
9+
410
main_branch=main
511
mismatches=0
612
toplevel="$(git rev-parse --show-toplevel)"

0 commit comments

Comments
 (0)