-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (42 loc) · 1.52 KB
/
osml_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
name: Update Submodules
on:
workflow_dispatch:
inputs:
DISPATCH_REPO_NAME:
required: true
description: repo name to dispatch
type: string
DISPATCH_REPO_SHA:
required: true
description: repo SHA to dispatch
type: string
jobs:
update_submodules:
if: ${{ github.ref == 'refs/heads/dev' }}
name: Update Submodules
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
submodules: true
fetch-depth: 0
- name: Checkout ${{ github.ref_name }} branch for each of the submodules
run: |
git submodule update --init --recursive --remote lib/${{ inputs.DISPATCH_REPO_NAME }}
git submodule set-branch --branch main lib/${{ inputs.DISPATCH_REPO_NAME }}
cd lib/${{ inputs.DISPATCH_REPO_NAME }}
git checkout ${{inputs.DISPATCH_REPO_SHA}}
cd ../../
git checkout .gitmodules
- name: Run Git Status
run: git status
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
base: ${{ github.ref_name }}
branch: Updates/submodule-${{ inputs.DISPATCH_REPO_NAME }}-updates
title: "release: ${{ inputs.DISPATCH_REPO_NAME }}@${{ github.ref_name }} - ${{inputs.DISPATCH_REPO_SHA}}"
commit-message: "release: ${{ inputs.DISPATCH_REPO_NAME }}@${{ github.ref_name }} - ${{inputs.DISPATCH_REPO_SHA}}"
labels: automated-bot