Git submodule:
- add another repo as submodule
# clone repo
git submodule add https://github.com/direct-devops/ansible-roles.git
git add .
git commit -m "added submodules"
git push
# module .gitmodules
[submodule "spring-petclinic"]
path = spring-petclinic
url = https://github.com/direct-devops/spring-petclinic
[submodule "ansible-roles"]
path = ansible-roles
url = https://github.com/direct-devops/ansible-roles.git
Refer here for checkout submodule repo
name: test submodule
on:
push:
branches: 'main'
jobs:
demo:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
with:
submodules: 'recursive'
# token: ${{ secrets.GITHUB_TOKEN }}
