-
-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (41 loc) · 1.3 KB
/
update-submodule.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
40
41
42
43
44
45
46
47
name: Update Submodule
on:
workflow_dispatch:
schedule:
- cron: "10,40 * * * *"
jobs:
update-submodule:
name: Update Submodule
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true
- name: Git submodule update
run: |
git pull --rebase=true --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
id: commit
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
if git commit -am "ci: update TLDR submodule" && git push; then
echo "anything-committed=true" >> $GITHUB_OUTPUT
else
echo "anything-committed=false" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Trigger Calculate Metrics
uses: actions/github-script@v7
if: ${{ steps.commit.outputs.anything-committed == 'true' }}
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'calculate-metrics.yml',
ref: 'main',
})