-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.39 KB
/
Copy pathsubmodule-update.yaml
File metadata and controls
54 lines (45 loc) · 1.39 KB
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
---
name: "Git submodule update workflow"
on:
workflow_call:
inputs:
pr-branch:
description: 'PR branch name'
required: false
default: 'submodule-update'
type: string
pr-title:
description: 'PR title'
required: false
default: "[submodule-update] Automated update"
type: string
jobs:
submodule-update:
name: "Update submodules and generate PR on changes"
runs-on: ubuntu-latest
steps:
- name: "Checkout configuration"
uses: actions/checkout@v3
with:
submodules: recursive
- name: "Update submodules"
run: |
git submodule update --init --recursive --remote
- name: "Check for changes"
id: update-check
run: |
git diff --quiet --exit-code || echo "updated=true" >> $GITHUB_OUTPUT
continue-on-error: true
- name: Create Pull Request
if: steps.update-check.outputs.updated == 'true'
uses: peter-evans/create-pull-request@v5
with:
commit-message: "[submodule-update] Automated submodule update"
branch: "${{ inputs.pr-branch }}"
delete-branch: true
title: "${{ inputs.pr-title }}"
body: |
Automated submodule update via [submodule-update](https://github.com/ravngr/github-workflows) workflow.
labels: |
automated pr
submodule