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

add support for gist.github.com #262

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gnawhleinad
Copy link
Contributor

I left a todo for (future?) GitHub Enterprise Server support because gists could be either on gist. or /gist depending on subdomain isolation.

@gnawhleinad gnawhleinad force-pushed the gist branch 7 times, most recently from d1cef55 to 9c88fe4 Compare May 30, 2020 06:52
@gnawhleinad
Copy link
Contributor Author

Looks like gist.github.com doesn't like it if you set Authorization headers on a fetch...

$ git remote add origin https://gist.github.com/d530295e01f1203e063a671b106f6be3
$ git config --local "http.https://gist.github.com/.extraheader" "AUTHORIZATION: basic x-access-token:hunter2"
$ git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/master:refs/remotes/origin/master
fatal: unable to access 'https://gist.github.com/d530295e01f1203e063a671b106f6be3/': The requested URL returned error: 400
$ git config --local --unset "http.https://gist.github.com/.extraheader"
$ git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/master:refs/remotes/origin/master
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 232 bytes | 232.00 KiB/s, done.
From https://gist.github.com/d530295e01f1203e063a671b106f6be3
 * [new branch]      master     -> origin/master

@gnawhleinad
Copy link
Contributor Author

Looks like gist.github.com doesn't like it if you set Authorization headers on a fetch...

NVM, it just doesn't like incorrect credentials. I was trying invalid credentials on a public gist and thought it failed because credentials were present...

@@ -68,6 +76,10 @@ export function getInputs(): IGitSourceSettings {
result.ref = `refs/heads/${result.ref}`
}
}

if (result.isGist && !result.ref && !result.commit) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this back from 00a3be8

let me know if you'd like me to change src/git-source-provider.ts instead.

@gbakeman gbakeman mentioned this pull request Mar 7, 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

Successfully merging this pull request may close these issues.

1 participant