Skip to content

Merge pull request #137 from Rico040/master #929

Merge pull request #137 from Rico040/master

Merge pull request #137 from Rico040/master #929

Workflow file for this run

name: 'Submodules Sync'
on:
# Allows you to run this workflow manually from the Actions tab or through HTTP API
push:
branches: [ master ]
workflow_dispatch:
jobs:
sync:
name: 'Submodules Sync'
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
- name: Checkout remote
uses: actions/checkout@v2
with:
repository: ${{ secrets.REMOTE_REPO }}
path: './remote'
submodules: true
- name: Checkout local
uses: actions/checkout@v2
with:
path: './local'
- name: Update and commit submodule
working-directory: ./remote
shell: bash
env:
REMOTE_REPO: ${{ secrets.REMOTE_REPO }}
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git pull --recurse-submodules
git submodule update --recursive --remote
git remote set-url origin "git@github.com:$REMOTE_REPO"
git commit -am "Updated documents submodule rippedpiracy/docs@$(git -C ../local rev-parse --short HEAD)" && git push