37 lines
1022 B
YAML
37 lines
1022 B
YAML
name: Kutegen submodule check
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- main
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
submodule-check:
|
|
runs-on: "docker"
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
token: ${{ secrets.GIT_HUB_ACCESS_TOKEN }}
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
- name: Submodule update
|
|
run: git submodule update --init --recursive --depth 0
|
|
- name: Check submodule
|
|
run: |
|
|
cd kutegen
|
|
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
|
|
git fetch origin main
|
|
BEHIND=$(git rev-list origin/main ^HEAD --count)
|
|
AHEAD=$(git rev-list HEAD ^origin/main --count)
|
|
if [ $AHEAD -ne 0] || [$BEHIND -ne 0 ]; then
|
|
echo "Submodule is not up to date with main branch."
|
|
exit 1
|
|
fi
|
|
echo "Submodule is up to date with main branch." |