Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking out HEADs of submodules #503

Open
vvasuki opened this issue May 13, 2021 · 2 comments
Open

Checking out HEADs of submodules #503

vvasuki opened this issue May 13, 2021 · 2 comments

Comments

@vvasuki
Copy link

vvasuki commented May 13, 2021

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
@AraHaan
Copy link

AraHaan commented May 19, 2021

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

The issue is because you specified depth of 1 to the action remove that line and the issue would go away.

Also depth of 1 on that command would be problematic as well, that is why you run into that issue too.

@vvasuki
Copy link
Author

vvasuki commented May 19, 2021

The issue is because you specified depth of 1 to the action remove that line and the issue would go away.

Also depth of 1 on that command would be problematic as well, that is why you run into that issue too.

https://github.com/vvasuki/kAvyam/runs/2618045918?check_suite_focus=true run of the workflow file https://github.com/vvasuki/kAvyam/actions/runs/856080271/workflow shows that removing depth 1 argument does not help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants