-
Notifications
You must be signed in to change notification settings - Fork 144
57 lines (47 loc) · 1.6 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
48
49
50
51
52
53
54
55
56
57
name: Update submodules
# TODO: Remove push, only using push temporarily while building this workflow
on: [push]
# Manual workflow: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
#on: workflow_dispatch
# TODO: Use schedule below once finalized
#on:
# schedule:
# - cron: '17 8 10 * *' # Run monthly on the 10th, at 8:17am
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write # Permit git push
steps:
- name: Set TODAY env var
run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Checkout project
uses: actions/checkout@v4
with:
submodules: true
- name: Create branch
run: git checkout -b submodules-update-$TODAY
- name: Run submodule updates
run: git submodule update --remote --checkout apps/24pullrequests
# run: git submodule update --remote --checkout
- name: Configure git user
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Commit
run: |
git add apps/24pullrequests
git commit -m "Update submodules $TODAY"
# run: git commit --all -m "Update submodules $TODAY"
- name: Push branch
run: |
git config push.autoSetupRemote true
git push
- name: Open pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create \
--base ${{ github.ref_name }}
--fill
--reviewer eliotsykes