generated from sapphiredev/sapphire-template
-
-
Notifications
You must be signed in to change notification settings - Fork 35
42 lines (40 loc) · 1.43 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
38
39
40
41
42
name: Update Git Submodules
on:
schedule:
- cron: '30 3 * * *'
workflow_dispatch:
jobs:
SubmoduleSync:
name: Update Git Submodules
runs-on: ubuntu-latest
if: github.repository_owner == 'sapphiredev'
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
token: ${{ secrets.SKYRA_TOKEN }}
submodules: 'recursive'
- name: Install dependencies
uses: sapphiredev/.github/actions/install-yarn-dependencies@main
with:
node-version: 20
- name: Configure Git
run: |
git remote set-url origin "https://${GITHUB_TOKEN}:[email protected]/${GITHUB_REPOSITORY}.git"
git config --local user.email "${GITHUB_EMAIL}"
git config --local user.name "${GITHUB_USER}"
env:
GITHUB_USER: github-actions[bot]
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update all submodules
run: yarn update-submodules
- name: Update lockfile
run: yarn install --mode=update-lockfile
- name: Commit and push any changes
run: |
git add --all .;
if ! git diff-index --quiet HEAD --; then
git commit -snm "chore: updated GitHub Submodules at $(date '+%F %H:%M.%S')"
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
fi