Update Submodule #4665
This file contains 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 Submodule | |
on: | |
schedule: | |
- cron: '*/15 * * * *' | |
jobs: | |
update-submodule: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repository | |
uses: actions/checkout@v2 | |
- name: Update Submodules | |
id: submodule_changes | |
run: | | |
git submodule update --remote | |
if [[ -n $(git status --porcelain) ]]; then | |
echo "Submodule changes detected." | |
echo "::set-output name=changes::true" | |
else | |
echo "No submodule changes detected." | |
echo "::set-output name=changes::false" | |
fi | |
- name: Commit and Push Changes | |
if: steps.submodule_changes.outputs.changes == 'true' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "Spectrum Labs Bot" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "Cron: Update Submodule" | |
git push --set-upstream origin $GITHUB_REF |