-
Notifications
You must be signed in to change notification settings - Fork 109
40 lines (36 loc) · 1.32 KB
/
sync-micro-manager-submodule.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
# When the main branch of this repo has a push, create a commit in
# micro-manager.git so that it has the latest revision of this repo.
# (The latest mmCoreAndDevices is used, not strictly the commit that triggered
# this workflow.)
name: Sync micro-manager submodule
on:
push:
branches:
- main
jobs:
sync-micro-manager-submodule:
name: Sync micro-manager submodule
if: github.repository == 'micro-manager/mmCoreAndDevices'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: micro-manager/micro-manager
ref: ${{ github.ref_name }} # Use matching branch
ssh-key: ${{ secrets.SSH_KEY_DEPLOY_TO_MICRO_MANAGER }}
path: micro-manager
submodules: false
- name: Commit and push if necessary
run: |
cd micro-manager
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git submodule init
git submodule update --remote -- mmCoreAndDevices
git add mmCoreAndDevices
if [ -z "$(git status --porcelain=v1 2>/dev/null)" ]; then
echo "No change to push"
else
git commit -m "Update mmCoreAndDevices submodule to latest"
git push
fi