forked from openebs/mayastor-control-plane
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (38 loc) · 1.13 KB
/
pr-submodule-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Submodule Branch Check
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
push:
branches:
- develop
- 'release/**'
- staging
jobs:
submodule-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event.pull_request.head.repo.fork
with:
fetch-depth: 0
submodules: recursive
- uses: actions/checkout@v4
if: "! github.event.pull_request.head.repo.fork"
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.ORG_CI_GITHUB }}
- name: Check root submodules branch
run: |
pr_branch="${{ github.event.pull_request.base.ref }}"
if [ -n "$pr_branch" ]; then
check_branch="$pr_branch"
else
check_branch="${{ github.ref_name }}"
fi
./scripts/git/set-submodule-branches.sh --branch "$check_branch"
cat .gitmodules
git diff --exit-code ".gitmodules"
- name: Check submodules HEAD points to branch
run: |
./scripts/git/check-submodule-branches.sh