-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.04 KB
/
update-submodules.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
---
name: Update submodules
on:
schedule: [{ cron: 0 3 * * * }]
workflow_dispatch:
jobs:
update-submodules:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{secrets.GITHUB_TOKEN}}
- name: Config Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update submodules
run: |
if git commit -am"chore(git): Update submodules (automated)
$(git submodule --quiet foreach \
'tag="$(git describe --tags --abbrev=0 origin/HEAD)"
if [ "$(git describe --tags)" != "$tag" ]; then
git checkout --quiet "$tag"
echo "$name" "$tag"
fi')"
then
git show --raw
git push
fi