Test change for workflow #2
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: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
check_submodule: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Check for submodule changes | |
id: check_changes | |
run: | | |
git diff --exit-code HEAD^ HEAD le-chess-backend || echo "changes=true" >> $GITHUB_OUTPUT | |
- name: Update submodule if changed | |
if: steps.check_changes.outputs.changes == 'true' | |
run: | | |
cd le-chess-backend | |
git fetch origin | |
git checkout origin/main | |
cd .. | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add le-chess-backend | |
git commit -m "Update le-chess-backend submodule" | |
git push |