-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace simple-git with octokit to load fiddle
- Loading branch information
1 parent
caa1f8d
commit 1db31f2
Showing
6 changed files
with
102 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function setGithubToken(githubToken: string) { | ||
process.env.FIDDLE_CORE_GITHUB_TOKEN = githubToken; | ||
} | ||
|
||
export function removeGithubToken() { | ||
delete process.env.FIDDLE_CORE_GITHUB_TOKEN; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Octokit } from '@octokit/rest'; | ||
|
||
let _octo: Octokit; | ||
/** | ||
* Returns a loaded Octokit. If state is passed and authentication | ||
* is available, we'll token-authenticate. | ||
* @returns {Octokit} | ||
*/ | ||
export function getOctokit(token?: string): Octokit { | ||
// It's possible to load Gists without being authenticated, | ||
// but we get better rate limits when authenticated. | ||
_octo = | ||
_octo || token | ||
? new Octokit({ | ||
auth: token, | ||
}) | ||
: new Octokit(); | ||
|
||
return _octo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -789,18 +789,6 @@ | |
"@types/yargs" "^16.0.0" | ||
chalk "^4.0.0" | ||
|
||
"@kwsites/file-exists@^1.1.1": | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/@kwsites/file-exists/-/file-exists-1.1.1.tgz#ad1efcac13e1987d8dbaf235ef3be5b0d96faa99" | ||
integrity sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw== | ||
dependencies: | ||
debug "^4.1.1" | ||
|
||
"@kwsites/promise-deferred@^1.1.1": | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919" | ||
integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw== | ||
|
||
"@microsoft/[email protected]": | ||
version "7.15.3" | ||
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.15.3.tgz#cf76deeeb2733d974da678f530c2dbaceb18a065" | ||
|
@@ -1119,7 +1107,7 @@ | |
node-fetch "^2.6.7" | ||
universal-user-agent "^6.0.0" | ||
|
||
"@octokit/rest@^19.0.0": | ||
"@octokit/rest@^19.0.0", "@octokit/rest@^19.0.4": | ||
version "19.0.4" | ||
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-19.0.4.tgz#fd8bed1cefffa486e9ae46a9dc608ce81bcfcbdd" | ||
integrity sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA== | ||
|
@@ -6101,15 +6089,6 @@ signale@^1.2.1: | |
figures "^2.0.0" | ||
pkg-conf "^2.1.0" | ||
|
||
simple-git@^2.48.0: | ||
version "2.48.0" | ||
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-2.48.0.tgz#87c262dba8f84d7b96bb3a713e9e34701c1f6e3b" | ||
integrity sha512-z4qtrRuaAFJS4PUd0g+xy7aN4y+RvEt/QTJpR184lhJguBA1S/LsVlvE/CM95RsYMOFJG3NGGDjqFCzKU19S/A== | ||
dependencies: | ||
"@kwsites/file-exists" "^1.1.1" | ||
"@kwsites/promise-deferred" "^1.1.1" | ||
debug "^4.3.2" | ||
|
||
sisteransi@^1.0.5: | ||
version "1.0.5" | ||
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" | ||
|