Skip to content

Commit 4c56b41

Browse files
authored
Add CI to validate protos version on cap-dev branch (#217)
* Added CI validation to ensure protos submodule points to cap-dev branch * Updated checkout action version * Moved validate-submodule CI to its own workflow * Moved permissions to job * Updated checkout action version
1 parent b386d8d commit 4c56b41

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Validate Submodule
2+
permissions: {}
3+
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
branches: [capabilities-development]
8+
push:
9+
branches: [capabilities-development]
10+
11+
jobs:
12+
validate-submodule:
13+
permissions:
14+
contents: read
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v6
19+
with:
20+
submodules: recursive
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Validate chainlink-protos points to capabilities-development
24+
run: |
25+
cd submodules/chainlink-protos
26+
SUBMODULE_COMMIT=$(git rev-parse HEAD)
27+
echo "Submodule commit: $SUBMODULE_COMMIT"
28+
29+
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
30+
echo "Shallow clone detected, fetching full history..."
31+
git fetch --unshallow origin
32+
fi
33+
git fetch origin capabilities-development
34+
35+
BRANCH_TIP=$(git rev-parse FETCH_HEAD)
36+
echo "capabilities-development tip: $BRANCH_TIP"
37+
38+
if git merge-base --is-ancestor "$SUBMODULE_COMMIT" "$BRANCH_TIP"; then
39+
echo "OK: Submodule commit $SUBMODULE_COMMIT is on the capabilities-development branch."
40+
else
41+
echo "::error::chainlink-protos submodule is at commit $SUBMODULE_COMMIT which is NOT on the capabilities-development branch."
42+
echo "Update the submodule to point to a commit from the capabilities-development branch."
43+
exit 1
44+
fi

0 commit comments

Comments
 (0)