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

fix(checkver): Monkey patch to prevent github rate limit hits #139

Merged
merged 7 commits into from
Apr 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
note
  • Loading branch information
Ash258 committed Apr 10, 2021
commit df1b6228708648dacf1e17f252c0c3de87b4b903
13 changes: 5 additions & 8 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,11 @@ $Search = $App
$Queue = @()
$UNIVERSAL_REGEX = '[vV]?([\d.]+)'
$GITHUB_REGEX = "/releases/tag/$UNIVERSAL_REGEX"
$exitCode = 0
$problems = 0
$GH_TOKEN = $env:GITHUB_TOKEN
$cfToken = get_config 'githubToken'
if ($cfToken) {
$GH_TOKEN = $cfToken
}
if ($cfToken) { $GH_TOKEN = $cfToken }
$exitCode = 0
$problems = 0

#region Functions
function next($AppName, $Err) {
Expand Down Expand Up @@ -291,9 +289,8 @@ foreach ($q in $Queue) {
if ($json.checkver.github) {
$url = $json.checkver.github.TrimEnd('/') + '/releases/latest'
$regex = $GITHUB_REGEX
if ($json.checkver.PSObject.Properties.Count -eq 1) {
$useGithubAPI = $true
}
# TODO: See if this could be used allways
if ($json.checkver.PSObject.Properties.Count -eq 1) { $useGithubAPI = $true }
}

if ($json.checkver.re) {
Expand Down