forked from cryostatio/cryostat-web
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.42 KB
/
submodule.yaml
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
40
41
42
43
44
45
46
47
48
name: submodule
on:
push:
branches:
- main
- v[0-9]+
- v[0-9]+.[0-9]+
- cryostat-v[0-9]+.[0-9]+
defaults:
run:
shell: bash
jobs:
update-submodule:
if: ${{ github.repository_owner == 'cryostatio' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: cryostatio/cryostat
token: "${{ secrets.SUBMODULE_TOKEN }}"
ref: "${{ github.ref_name }}"
- name: Check remote cryostat submodule branch
run: |
remote_branch="$(git config --get -f .gitmodules submodule."src/main/webui".branch)"
if [[ "$remote_branch" != "${{ github.ref_name }}" ]]; then
printf "Expected remote branch %s, found branch %s\n" "${{ github.ref_name }}" "$remote_branch" >&2
exit 1
fi
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Update submodule to latest commit
run: |
git submodule update --init
git submodule update --remote
- name: Commit and push submodule
run: |
git add --all
git_hash="$(git rev-parse --short :src/main/webui)"
git commit -S -m "build(webui): update submodule to $git_hash" || echo "No changes to commit"
git push