-
Notifications
You must be signed in to change notification settings - Fork 22
45 lines (41 loc) · 1.36 KB
/
update-james-submodule.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
name: Create PR to update James submodule
on:
schedule:
- cron: '1 */4 * * *'
workflow_dispatch:
jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
ref: master
- name: Check if submodule is updated
id: check-submodule
run: |
git fetch origin master
git reset --hard origin/master
git submodule update --remote
git config user.name 'github[bot]'
git config user.email '[email protected]'
if [ "$(git diff --submodule=log)" != "" ]; then
echo "Submodule has changes"
git add james-project
echo "changed=yes" >> $GITHUB_OUTPUT
else
echo "No changes in submodule"
echo "changed=no" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request to Upstream if submodule updated
if: ${{ steps.check-submodule.outputs.changed == 'yes' }}
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update James SHA-1
title: "Update James submodule to latest version"
body: |
This pull request updates the James SHA-1 submodule to the latest version.
branch: upgradeSha1
base: master
labels: bot
delete-branch: true