-
Notifications
You must be signed in to change notification settings - Fork 21
37 lines (32 loc) · 1.23 KB
/
submodules_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
name: Update Submodules
on:
# schedule:
# run daily at midnight
# - cron: '0 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Uses the private access token from above link
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Initialize or update each one recursively
- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
# Commit to the repo under the GitHub actions user to ensure we have
# reasonable logging to trace back
- name: Commit & push changes
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions - update submodules"
git commit -am "Update submodules" || echo "No changes to commit"
- name: Push to protected branch
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUSH_PROTECTED_BRANCH_TOKEN }} # This requires a special token to be able to trigger checks on new branch creation
ref: ${{ github.ref }}