-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (39 loc) · 1.45 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
43
44
45
46
47
name: Update submodules (theme)
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# This workflow contains a single job called "update"
update:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Commit & push changes
run: |
DATE=$(date '+%Y%m%d-%H%M')
BRANCH_NAME="update-submodules/update-$DATE"
# Setup the committers identity.
git config user.email "[email protected]"
git config user.name "GitHub Actions - update theme submodule"
git checkout -b $BRANCH_NAME
git submodule update --init --recursive
git submodule update --recursive --remote
git commit -am "Update submodules"
git push origin $BRANCH_NAME
- name: create pull request
run: |
DATE=$(date '+%Y%m%d-%H%M')
BRANCH_NAME="update-submodules/update-$DATE"
gh pr create \
-B main \
-H $BRANCH_NAME \
--title "Update site submodules" \
--body "Created by Github action"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}