Skip to content

Test change for workflow #2

Test change for workflow

Test change for workflow #2

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