-
-
Notifications
You must be signed in to change notification settings - Fork 18
39 lines (34 loc) · 967 Bytes
/
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
name: Update submodules
on:
workflow_dispatch:
schedule:
# Run every day
- cron: '0 3 * * *'
jobs:
submodule:
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
with:
submodules: true
- name: Update submodules
run: |
set -ex
git submodule update --remote
- name: Commit/push if changed
run: |
set -ex
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git diff --quiet --exit-code && exit
git commit -a -m 'Update submodules'
git push
workflow-keepalive:
runs-on: ubuntu-latest
steps:
- name: Re-enable workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api -X PUT repos/${{ github.repository }}/actions/workflows/submodule.yaml/enable