3

I have a Github workflow file with a checkout action that looks something like this:

name: Build project

on:
  workflow_dispatch:
    # Allows for manual build trigger

jobs:
  buildForAllSupportedPlatforms:
    name: Build for ${{ matrix.targetPlatform }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
          submodules: true

This does the logical thing, it checks out the submodules with something like submodule update --init --force. Here's my question - How do I make all the submodules check out on the master branch?

torek
  • 448,244
  • 59
  • 642
  • 775
Dr-Bracket
  • 4,299
  • 3
  • 20
  • 28

2 Answers2

0

Figured out something that works - Just add another step after uses: actions/checkout@v2:

      - name: Checkout master on all submodules
        run: |
          git submodule foreach git checkout master
          git submodule foreach git pull origin master
Dr-Bracket
  • 4,299
  • 3
  • 20
  • 28
0

Try this

    - name: Checkout submodule
      uses: actions/checkout@v2
      with:
        token: '${{ secrets.GITHUB_PAT }}'
        repository: myOrg/myRepo
        path: path/to/submodule
        ref: 'master'
Hervera
  • 584
  • 9
  • 17