-
Notifications
You must be signed in to change notification settings - Fork 114
40 lines (34 loc) · 1.34 KB
/
nightly-update.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: Update Submodules
on:
# Run nightly: 8am UTC = 3am Eastern
schedule:
- cron: '0 8 * * *'
# Or run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
update-submodules:
# only run on the main repo; forks can pull changes from there
if: github.repository == 'TriForceX/MiyooCFW'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Github Personal Access Token
# needed because pushes with the deafult GITHUB_TOKEN won't trigger the build step
token: ${{ secrets.GH_PAT }}
# do NOT set submodules: true here - it does a funky checkout that keeps updating from working
- name: Update all submodules
id: update
run: |
git submodule init
# update submodules to the latest remote version
git submodule update --remote --merge
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs
echo "changes=$(git status -z --porcelain)" >> $GITHUB_OUTPUT
- name: Push changes
if: ${{ steps.update.outputs.changes }}
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git commit -am "Updated submodules $(date)"
git push