Https git-based documentation inaccurate due to non-escaped html characters


#1

THe following page indicate the following:

HTTP-based Git access by an installation
Installations with permissions on "contents" of a repository, can use their access tokens to authenticate for Git access. The token is used as the HTTP password.

git clone https://x-access-token:@github.com/owner/repo.git

the <token> part between the : and the @ is missing as the < and > are not escaped thus is interpreted by browsers as a <token> tag which is invisible… and make the documentation confusing.

Thanks.


#2

Thanks so much for reporting this, @Carreau – I’ve opened an internal issue so that we can fix this up. We’ll followup here once this is fixed. :bow:


#3

Thanks @izuzak. I was unsure if opening here was the right thing or if I should “Contact a Human” on the main github website. Really good documentation otherwise. A pleasure to work with.


#4

Just wanted to say thanks. I was going in circles on this for a few hours trying all sorts of combinations, but it never occurred to me to check the page source!


#5

Happy it helped. I actually found the solution before looking at the source, and then was… well they should have added <token> after the colon. Then thought “Wait a second…” and looked at the source.


#6

I can’t seem to get this to work. I just retrieve a token it works with all the other REST APIs.

I’m trying to clone an repo available (I have proper permissions for repo contents).

I’m using the format found in forums:

git clone https://x-access-token:v1.c1xyz123thisisnotreal@github.com/foo/bar.git

I get the following error:

Cloning into 'fetcher'...
remote: Repository not found.
fatal: repository 'https://x-access-token:v1.c1cXXXXXXX@github.com/foo/bar.git/' not found

The trailing slash leads me to believe something is wrong in the URL. But I can’t figure it out. Everyone else seems to suggest this is the right format that works looking at other threads.

I’m banging my head trying different combinations. Anyone know what I’m doing wrong?


#7

I don’t see any mistakes in what you are doing. Here is the exact line I use in Python:

process = subprocess.run(['git', 'clone', 'https://x-access-token:{}@github.com/{}/{}'.format(atk, org_name, repo_name)])

The only difference I see is i don’t have the .git either. Are you running things locally ? Could your git credentials/config interfere ? Mine is set to use ssh on github domain (ssh.github.com port 443) was interfeering and I had to disable it.


#8

Yeah, I thought about that too. I create a clean docker container (ubuntu), installed git fresh and it still doesn’t work. Still get an error (404). These repos were recently moved from my personal account into an org (via transfer). I wonder if this is related?


#9

OK, I finally figured it out! I was trying to test with a repo that I hadn’t given access to the integration (I’ve been testing with a bunch of different repos with scenarios). Dumb user mistake. +1 Computer


#10

This is now solved. The page have been updated. Is there any way to mark this as closed ?


#11