actions / actions/checkout

Submodule cloning: Needed a single revision

Open
#418 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
8.9k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

Problem:
Pipeline failing to clone submodule.
image

Environment:
Both the main repository and submodule are private repositories belonging to the same organisation. I am the owner of the organisation and I have created a PAT with full repo access. This PAT is then added as secret the the main repository.

Pipeline Config:

build:

    runs-on: self-hosted

    strategy:
      matrix:
        node-version: [10.x, 12.x, 14.x, 15.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        token: ${{ secrets.CI_PAT }}
        submodules: true
        persist-credentials: true
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci
    - run: npm run build --if-present
    - run: npm test

.gitmodules:

[submodule "src/shared"]
	path = src/shared
	url = https://github.com/<org>/<sub-module-repo>.git
	branch = main

If I omit the branch it does not work either.

Self-Hosted:
I am running the pipelines on two of our servers. Both have docker installed and I dont have issues with any other repository that does not include any submodules.
They are both running latest ubtunu 20.04 LTS on x64.
Latest git version has been installed using apt install git

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the workflow's actions/checkout@v2 step and the .gitmodules entry for src/shared, then reproduce the private-submodule failure on the self-hosted setup described. Compare checkout behavior with and without the branch setting and the supplied token. Done means identifying the cause and documenting a verified configuration or confirmed limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.