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

Submodule cloning: Needed a single revision #418

Open
Flusinerd opened this issue Jan 6, 2021 · 3 comments
Open

Submodule cloning: Needed a single revision #418

Flusinerd opened this issue Jan 6, 2021 · 3 comments

Comments

@Flusinerd
Copy link

Flusinerd commented Jan 6, 2021

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

@NotMyself
Copy link

Did you ever find a solution to this issue?

@Flusinerd
Copy link
Author

Flusinerd commented Apr 8, 2022

Hey, I think I did not. We moved to a monorepo.

@NotMyself
Copy link

Well, if you ever run into it again. This is what worked for me. Note the first step does not get submodules a tall.... The second step does though.

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Source
      uses: actions/checkout@v3
      with:
        token: ${{secrets.TEMPLATE_REPO_PAT}}
        submodules: true
        persist-credentials: true
    - name: Checkout submodules using a PAT
      run: |
        git config --file .gitmodules --get-regexp url | while read url; do
          git config --file=.gitmodules $(echo "$url" | sed -E "s/[email protected]:|https:\/\/github.com\//https:\/\/${{ secrets.TEMPLATE_REPO_PAT }}:${{ secrets.TEMPLATE_REPO_PAT }}@github.com\//")
        done
        git submodule sync
        git submodule update --init --recursive

artembo added a commit to artembo/tarantool that referenced this issue Jun 1, 2022
Added `tarantool/actions/cleanup` action to each job which uses
self-hosted runners.

The action cleans workspace directory of self-hosted runner after
previous run. The main reason to add this action is 'Need a single
revision' error [1] caused by a conflict of submodule versions,
the standard 'actions/checkout' action fails with this error. It's a
well-known problem and related issue [2] is still opened.

[1] tarantool/tarantool-qa#145
[2] actions/checkout#418

NO_DOC=ci
NO_TEST=ci
NO_CHANGELOG=ci

Closes tarantool/tarantool-qa#145
artembo added a commit to tarantool/tarantool that referenced this issue Jun 1, 2022
Added 'tarantool/actions/cleanup' action to each job which uses
self-hosted runners.

The action cleans workspace directory of self-hosted runner after
previous run. The main reason to add this action is 'Need a single
revision' error [1] caused by a conflict of submodule versions,
the standard 'actions/checkout' action fails with this error. It's a
well-known problem and related issue [2] is still opened.

[1] tarantool/tarantool-qa#145
[2] actions/checkout#418

NO_DOC=ci
NO_TEST=ci
NO_CHANGELOG=ci

Closes tarantool/tarantool-qa#145
artembo added a commit to tarantool/tarantool that referenced this issue Jun 1, 2022
Added 'tarantool/actions/cleanup' action to each job which uses
self-hosted runners.

The action cleans workspace directory of self-hosted runner after
previous run. The main reason to add this action is 'Need a single
revision' error [1] caused by a conflict of submodule versions,
the standard 'actions/checkout' action fails with this error. It's a
well-known problem and related issue [2] is still opened.

[1] tarantool/tarantool-qa#145
[2] actions/checkout#418

NO_DOC=ci
NO_TEST=ci
NO_CHANGELOG=ci

Closes tarantool/tarantool-qa#145
ylobankov pushed a commit to tarantool/tarantool that referenced this issue Jun 1, 2022
Added 'tarantool/actions/cleanup' action to each job which uses
self-hosted runners.

The action cleans workspace directory of self-hosted runner after
previous run. The main reason to add this action is 'Need a single
revision' error [1] caused by a conflict of submodule versions,
the standard 'actions/checkout' action fails with this error. It's a
well-known problem and related issue [2] is still opened.

[1] tarantool/tarantool-qa#145
[2] actions/checkout#418

NO_DOC=ci
NO_TEST=ci
NO_CHANGELOG=ci

Closes tarantool/tarantool-qa#145

(cherry picked from commit 7ff8740)
mkokryashkin pushed a commit to mkokryashkin/tarantool that referenced this issue Sep 9, 2022
Added 'tarantool/actions/cleanup' action to each job which uses
self-hosted runners.

The action cleans workspace directory of self-hosted runner after
previous run. The main reason to add this action is 'Need a single
revision' error [1] caused by a conflict of submodule versions,
the standard 'actions/checkout' action fails with this error. It's a
well-known problem and related issue [2] is still opened.

[1] tarantool/tarantool-qa#145
[2] actions/checkout#418

NO_DOC=ci
NO_TEST=ci
NO_CHANGELOG=ci

Closes tarantool/tarantool-qa#145
ylobankov pushed a commit to tarantool/tarantool that referenced this issue Oct 28, 2022
Added 'tarantool/actions/cleanup' action to each job which uses
self-hosted runners.

The action cleans workspace directory of self-hosted runner after
previous run. The main reason to add this action is 'Need a single
revision' error [1] caused by a conflict of submodule versions,
the standard 'actions/checkout' action fails with this error. It's a
well-known problem and related issue [2] is still opened.

[1] tarantool/tarantool-qa#145
[2] actions/checkout#418

NO_DOC=ci
NO_TEST=ci
NO_CHANGELOG=ci

Closes tarantool/tarantool-qa#145

(cherry picked from commit 7ff8740)
ylobankov pushed a commit to tarantool/tarantool that referenced this issue Oct 28, 2022
Added 'tarantool/actions/cleanup' action to each job which uses
self-hosted runners.

The action cleans workspace directory of self-hosted runner after
previous run. The main reason to add this action is 'Need a single
revision' error [1] caused by a conflict of submodule versions,
the standard 'actions/checkout' action fails with this error. It's a
well-known problem and related issue [2] is still opened.

[1] tarantool/tarantool-qa#145
[2] actions/checkout#418

NO_DOC=ci
NO_TEST=ci
NO_CHANGELOG=ci

Closes tarantool/tarantool-qa#145

(cherry picked from commit 7ff8740)
feisuzhu added a commit to taichi-dev/taichi that referenced this issue Jan 6, 2023
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this issue Jan 6, 2023
PGZXB pushed a commit to PGZXB/taichi that referenced this issue Jan 6, 2023
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this issue Jan 12, 2023
quadpixels pushed a commit to quadpixels/taichi that referenced this issue May 13, 2023
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