forked from MissouriMRDT/RoveComm_Base
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 2.19 KB
/
sync.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Sync RoveComm Repos
on:
# push:
# branches:
# - master
workflow_dispatch:
jobs:
sync-repos:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: rovecomm
path: manifest
branch: dev
- name: rovecomm-typescript
path: manifest
branch: main
- name: rovecomm_cpp
path: data/RoveComm
branch: development
- name: rovecomm_python
path: manifest
branch: dev
- name: rovecomm_swift
path: Sources/RoveComm_Swift/Resources/Manifest
branch: development
steps:
- name: Checkout rovecomm_base
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Get current commit SHA
id: get_sha
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Generate commit message
id: commit_msg
run: echo "::set-output name=msg::Update due to changes in rovecomm_base"
- name: Clone and update submodule for ${{ matrix.name }}
run: |
git clone https://github.com/mrdt-software/${{ matrix.name }}.git
cd ${{ matrix.name }}
git submodule update --init --recursive
cd ${{ matrix.path }}
git checkout ${{ steps.get_sha.outputs.sha }}
cd -
git add ${{ matrix.path }}
git commit -m "${{ steps.commit_msg.outputs.msg }}"
git checkout -b sync/${{ steps.get_sha.outputs.sha }}
git push origin sync/${{ steps.get_sha.outputs.sha }}
- name: Create pull request for ${{ matrix.name }}
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: mrdt-software/${{ matrix.name }}
base: ${{ matrix.branch }}
head: sync/${{ steps.get_sha.outputs.sha }}
title: 'Sync Manifest to ${{ steps.get_sha.outputs.sha }}'
body: 'This is an automated pull request to update the repository due to changes in rovecomm_base.'