-
Notifications
You must be signed in to change notification settings - Fork 177
55 lines (46 loc) · 1.59 KB
/
UpdateUESubmodule.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
name: Update UE Submodule and PR
on:
workflow_dispatch:
env:
COMMITS_BODY: ''
jobs:
update-submodule:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Setup github SSH for UEPseudo
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.UEPSEUDO_SSH_KEY }}
known_hosts: unnecessary
- name: Checkout
uses: actions/checkout@v4
- name: Initialize submodule
run: |
git submodule update --init --recursive
- name: Get commits between HEAD and main in the submodule
id: submodule-commits
run: |
cd ./deps/first/Unreal
git fetch origin main
git log HEAD..main --pretty="tformat:* %s (**%an**) _%h_" >> submodule-commits.txt
body=$(cat submodule-commits.txt)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "COMMITS_BODY=$body" >> $GITHUB_ENV
- name: Update submodule to latest commit on main branch
run: |
cd ./deps/first/Unreal
git checkout main
git pull origin main
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update UE Submodule
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: Update UE Submodule
body: ${{ env.COMMITS_BODY }}
branch: update-ue-submodule
base: main