Powershell scripts to dump commit and contributor lists.
This commit is contained in:
31
Tools/dump_commits_since.ps1
Executable file
31
Tools/dump_commits_since.ps1
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
[cmdletbinding()]
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[DateTime]$since,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$repo);
|
||||
|
||||
$r = @()
|
||||
|
||||
$qParams = @{
|
||||
"since" = $since.ToString("o")
|
||||
"per_page" = 100
|
||||
}
|
||||
|
||||
$url = "https://api.github.com/repos/{0}/commits" -f $repo
|
||||
|
||||
while ($null -ne $url)
|
||||
{
|
||||
$resp = Invoke-WebRequest $url -Body $qParams
|
||||
|
||||
$url = $resp.RelationLink.next
|
||||
|
||||
$j = ConvertFrom-Json $resp.Content
|
||||
$r += $j
|
||||
}
|
||||
|
||||
return $r
|
||||
Reference in New Issue
Block a user