-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
61 lines (58 loc) · 1.71 KB
/
action.yaml
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
58
59
60
61
name: Commit Parent Repo
description: Action to commit submodule changes to the parent repo
inputs:
is-child:
description: Whether this repo is the child repo
required: false
default: "false"
is-parent:
description: Whether this repo is the parent repo
required: false
default: "false"
pat:
description: PAT for accessing the other repo
required: true
head-branch:
description: Name of the HEAD branch
required: false
parent-repo:
description: Name of the parent repo
required: false
runs:
using: composite
steps:
- name: Trigger Parent Event
if: inputs.is-child == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ inputs.pat }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'beezlabs-org',
repo: '${{ inputs.parent-repo }}',
workflow_id: 'commit-parent-repo.yaml',
ref: '${{ inputs.head-branch }}'
})
- name: Checkout
if: inputs.is-parent == 'true'
uses: actions/checkout@v2
with:
token: ${{ inputs.pat }}
submodules: recursive
- name: Pull & update submodules recursively
if: inputs.is-parent == 'true'
run: |
git submodule update --init --recursive --remote
shell: bash
- name: Commit Changes
if: inputs.is-parent == 'true'
env:
GIT_AUTHOR_NAME: Beez Innovation Labs
GIT_COMMITTER_NAME: Beez Innovation Labs
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_EMAIL: [email protected]
run: |
git add -A
git diff-index --quiet HEAD || git commit -m "feat: update submodules"
git push
shell: bash