Skip to content

Checking out HEADs of submodules #503

Open
@vvasuki

Description

@vvasuki

I recently had much trouble using this action as part of an attempt to checkout submoudle HEADS - See here . It would be great if the action were to be able to do it automatically! Anyway, what I tried was:

    - name: Checkout
      uses: actions/checkout@master
      with:
        submodules: true
        fetch-depth: 1
    - name: Update submodules
      if: ${{ github.event_name != 'pull_request'}}
      run: |
        git pull --recurse-submodules --depth 1
        git submodule update --remote --merge

The result was:

Run git pull --recurse-submodules --depth 1
From https://github.com/vvasuki/kAvyam
 * [new branch]      content         -> origin/content
 * [new branch]      gh-pages        -> origin/gh-pages
 * [new branch]      offline_android -> origin/offline_android
 * [new branch]      trigger_branch  -> origin/trigger_branch
Fetching submodule content
Fetching submodule themes/sanskrit-documentation-theme-hugo
Already up to date.
fatal: Needed a single revision
Unable to find current origin/content revision in submodule path 'content'
Error: Process completed with exit code 1.

The following worked:

Disabling submodules initialization in the action as below

    - name: Checkout
      uses: actions/checkout@master
      with:
        submodules: false

Manual updation:

    - name: Update submodules
      if: ${{ github.event_name != 'pull_request'}}
      run: |
        set -o xtrace
        git submodule update --init --recursive
        git submodule update --remote --merge --recursive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions