Comments (27)
I ran into this same issue and made a slightly different tweak. As part of my workflow I use .gitconfig
to tweak the URLs. That way I don't have to switch from using the git protocol to https in my .gitmodules
file and affect my development setup.
As my first step in my YAML file, before running actions/checkout
with submodules: true
:
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "[email protected]:"' >> ~/.gitconfig
@TingluoHuang I feel like this issue should be reopened if it's not the desired behavior, and if it is I think it needs to be better documented. I can open another issue if that is desirable.
from checkout.
@socar-baegoon did you configure your submodule via
ssh
? can you try configure your submodule usinghttps://github.com/org/repo
format?
Thank you! It works!
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: develop
token: ${{ secrets.BAEGOON_TOKEN }}
submodules: true
[submodule "subprojects/protocol/src/main/proto"]
path = subprojects/protocol/src/main/proto
url = https://github.com/owner/protocol.git
from checkout.
If this helps anyone, this is working for me:
- using a/the github token
- to clone a URL accessed via
[email protected]/user/repo.git
(maybe via submodules/homebrew/a script/something else) - in GH actions
- with
runs-on: [macOS-latest]
# disable the keychain credential helper
git config --global credential.helper ""
# enable the local store credential helper
git config --global --add credential.helper store
# add credential
echo "https://x-access-token:${{ secrets.A_TOKEN }}@github.com" >> ~/.git-credentials
# tell git to use https instead of ssh whenever it encounters it
git config --global url."https://github.com/".insteadof [email protected]:
# do something
git clone [email protected]:user/repo.git
from checkout.
@socar-baegoon did you configure your submodule via
ssh
? can you try configure your submodule usinghttps://github.com/org/repo
format?
This issue occurs not because of ssh, but because of private repository.
submodule is in the same owner's repository, but the issue occurs. 😢
from checkout.
Big thanks to @rcoup for sharing the solution. I used it directly in the yml. Had to be careful because of the colon:
steps:
- uses: actions/checkout@v1 # without submodules
- name: disable the keychain credential helper
run: git config --global credential.helper ""
- name: enable the local store credential helper
run: git config --global --add credential.helper store
- name: add credential
run: echo "https://x-access-token:${{ secrets.SUBMODULE_CLONE_TOKEN }}@github.com" >> ~/.git-credentials
- name: tell git to use https instead of ssh whenever it encounters it
run: 'git config --global url."https://github.com/".insteadof [email protected]:'
- name: do smoething
run: {that updates submodules}
from checkout.
it works for me as a solution 2023:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
token: ${{ secrets.SUBMODULE_GITHUB_TOKEN }}
from checkout.
@maxilevi have your try set token
to be your PAT? the default GITHUB_TOKEN
might not have permission to your submodules repo.
from checkout.
@socar-baegoon did you configure your submodule via ssh
? can you try configure your submodule using https://github.com/org/repo
format?
from checkout.
Please refer to this link.
#14 (comment)and please use this link to create a token.
https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
@socar-baegoon Thank you. I got it working following your instructions.
from checkout.
@joeshaw I'm having no luck with your approach.
I made a personal access token with the scope public_repo
, then in my repo that has the submodules I created a secret called ACCESS_TOKEN
and pasted the token in there.
This is what I have in my yaml file:
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [13.x]
steps:
- run: echo -e '[url "https://github.com/"]\n insteadOf = "[email protected]:"' >> ~/.gitconfig
# I verified that the output looks fine
- run: cat ~/.gitconfig
- uses: actions/checkout@v1
with:
submodules: 'recursive'
token: ${{ secrets.ACCESS_TOKEN }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm i
npm test
env:
CI: true
which results in the same errors as others above:
Host key verification failed.
##[error]fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
##[error]fatal: clone of '[email protected]:infamous/element.git' into submodule path '/home/runner/work/umbrella/umbrella/packages/element' failed
Failed to clone 'packages/element'. Retry scheduled
Did I do something obviously wrong?
EDIT: I gave up, and converted all my git submodule URLs to https
format inside .gitmodules
. That worked fine.
from checkout.
@trusktr look carefully at your error message. It’s failing to pull from bitbucket, not github. You’ll need a similar insteadOf
for it.
from checkout.
@socar-baegoon did you configure your submodule via
ssh
? can you try configure your submodule usinghttps://github.com/org/repo
format?Thank you! It works!
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@master with: ref: develop token: ${{ secrets.BAEGOON_TOKEN }} submodules: true[submodule "subprojects/protocol/src/main/proto"] path = subprojects/protocol/src/main/proto url = https://github.com/owner/protocol.git
Not working for me
This solution was a year ago.
I don't use submodules anymore.
If you continue to have difficulties, I recommend you to package and use the module.
Very easy!!! (https://docs.github.com/en/packages)
Good luck 👍
from checkout.
Tried that and it didn't work.
Cloning into '/home/runner/work/xxx/xxx/player'...
remote: Repository not found.
fatal: repository 'https://github.com/yyy/zzz/' not found
from checkout.
(In my case it's a different owner—org vs personal—but still can't make it work. All are private repos.)
from checkout.
This is happening to me too. I've tried setting the token
input but it didn't work either.
from checkout.
@TingluoHuang Yes, I've created a new PAT with full repo access and added it as a secret to the repository. Then I called the action this way:
- uses: actions/checkout@v1
with:
token: ${{ secrets.HEDRA_CI }}
submodules: true
And it fails with the following error (same as the other guys):
Host key verification failed.
##[error]fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
##[error]fatal: clone of '[email protected]:maxilevi/zzz.git' into submodule path 'D:/a/yyy/zzz' failed
Failed to clone 'zzz'. Retry scheduled
from checkout.
@maxilevi your submodules are configured via ssh
, can you try add them as https
?
from checkout.
@TingluoHuang Thank you, it works now. Any plans on supporting ssh?
from checkout.
I will close this issue.
Thank you for everybody help. ❤️
from checkout.
@joeshaw i am in the process of documenting all these problems.
from checkout.
Hi there, I am having exactly the same issue here.
Although my submodule is configured to use https
All submodules are authenticated using the same credentials so I wonder why GITHUB_TOKEN
does not work.
from checkout.
Hi there, I am having exactly the same issue here.
Although my submodule is configured to use https
All submodules are authenticated using the same credentials so I wonder why
GITHUB_TOKEN
does not work.
Please refer to this link.
#14 (comment)
and please use this link to create a token.
https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
from checkout.
@socar-baegoon did you configure your submodule via
ssh
? can you try configure your submodule usinghttps://github.com/org/repo
format?Thank you! It works!
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@master with: ref: develop token: ${{ secrets.BAEGOON_TOKEN }} submodules: true[submodule "subprojects/protocol/src/main/proto"] path = subprojects/protocol/src/main/proto url = https://github.com/owner/protocol.git
This should be added into the manual page.
from checkout.
@socar-baegoon did you configure your submodule via
ssh
? can you try configure your submodule usinghttps://github.com/org/repo
format?Thank you! It works!
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@master with: ref: develop token: ${{ secrets.BAEGOON_TOKEN }} submodules: true[submodule "subprojects/protocol/src/main/proto"] path = subprojects/protocol/src/main/proto url = https://github.com/owner/protocol.git
Not working for me
from checkout.
@h1manshug using ssh-key
would be another option:
jobs:
tests:
steps:
- uses: actions/checkout@master
with:
ssh-key: ${{ secrets.CI_SSH_PRIVATE_KEY }}
submodules: true
You might want to create a machine user to hold the ssh key for you.
from checkout.
this way the workflow can switch between https and ssh
[submodule "subprojects/protocol/src/main/proto"]
path = subprojects/protocol/src/main/proto
url = [email protected]:owner/protocol.git
from checkout.
@lencshu's solution worked for me. Created the access token on my personal repo, made sure to give it full read/write persmissions.
from checkout.
Related Issues (20)
- Github CI can't fetch submodule from git:// GNU savannah, unless it refers to upstream HEAD HOT 1
- import of .gitconfig on self-hosted runner causing git fetch failure
- :error::codeql/upload-sarif action failed: Input required and not supplied: token HOT 1
- how soon v3 will not be supported HOT 1
- t ref: master
- https://azam.plus/public/udids/member/login.php
- Run actions/checkout@v2 with: repository: tectonic/infrastructure-helm token: *** path: infrastructure-helm fetch-depth: 0 ssh-strict: true persist-credentials: true clean: true lfs: false submodules: false env: XDG_DATA_HOME: /root/.local/share KUBECONFIG: /root/kubeconfig AWS_DEFAULT_REGION: eu-central-1 AWS_REGION: eu-central-1 AWS_ACCESS_KEY_ID: *** AWS_SECRET_ACCESS_KEY: *** /usr/bin/docker exec
- fetch-depth question HOT 1
- Qiiqo
- Pwn3rzs.and.CyberArsenal
- k@alahmad
- 4413a
- 4413a
- 1
- `fetch-branches` option?
- checkout does not honour show-progress: false
- ERROR: when run action/checkout@v3 HOT 3
- www2.4413@ HOT 1
- metaproblem: recursive checkout of private submodules causing grief HOT 1
- The parameter `-- prune` should be disabled when using submodules.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkout.