Skip to content

Commit

Permalink
Test change for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AESMatias committed Sep 27, 2024
1 parent c4a327f commit 86e862e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/updating_submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,33 @@ name: Update Submodule
on:
push:
branches:
- main
paths:
- 'le-chess-backend/**' # Submodule PATH
- main # o el nombre de tu rama principal donde está el submódulo
workflow_dispatch: # permite ejecutar el workflow manualmente

jobs:
update_submodule:
check_submodule:
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true # Cloning the submodules
fetch-depth: 0
submodules: 'recursive'

- name: Pull latest submodule changes
- name: Check for submodule changes
id: check_changes
run: |
cd le-chess-backend
git pull origin main
git diff --exit-code HEAD^ HEAD le-chess-backend || echo "changes=true" >> $GITHUB_OUTPUT
- name: Add and commit updated submodule
- name: Update submodule if changed
if: steps.check_changes.outputs.changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
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 "Updating le-chess-backend submodule to latest version"
git push origin main
git commit -m "Update le-chess-backend submodule"
git push
2 changes: 1 addition & 1 deletion le-chess-backend
Submodule le-chess-backend updated 1 files
+1 −0 .test

0 comments on commit 86e862e

Please sign in to comment.