Update Submodules #995
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Submodules | |
on: | |
workflow_dispatch: | |
inputs: | |
repository: | |
description: 'Repository that triggered the update' | |
required: true | |
ref: | |
description: 'The branch or tag that was pushed' | |
required: true | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.RUBROT_PAT }} | |
submodules: recursive | |
- name: Git config | |
run: | | |
git config user.name rubrot | |
git config user.email ros@rubriclabs.com | |
- name: Update submodules | |
run: | | |
git submodule update --remote | |
git diff --exit-code || { | |
git add . | |
git commit -m "Update submodules (triggered by ${{ github.event.inputs.repository }})" | |
git push | |
} |