Update contributors scripts to do more stuff

This commit is contained in:
Pieter-Jan Briers
2022-03-18 20:32:16 +01:00
parent 8bf00b40cd
commit d0c0dfc1dc
2 changed files with 26 additions and 5 deletions

View File

@@ -6,16 +6,22 @@ param(
[Parameter(Mandatory=$true)]
[DateTime]$since,
[Nullable[DateTime]]$until,
[Parameter(Mandatory=$true)]
[string]$repo);
$r = @()
$qParams = @{
"since" = $since.ToString("o")
"since" = $since.ToString("o");
"per_page" = 100
}
if ($until -ne $null) {
$qParams["until"] = $until.ToString("o")
}
$url = "https://api.github.com/repos/{0}/commits" -f $repo
while ($null -ne $url)

View File

@@ -4,13 +4,28 @@
param(
[Parameter(Mandatory=$true)]
[DateTime]$since);
[DateTime]$since,
$engine = & "$PSScriptRoot\dump_commits_since.ps1" -repo space-wizards/RobustToolbox -since $since
$content = & "$PSScriptRoot\dump_commits_since.ps1" -repo space-wizards/space-station-14 -since $since
[Nullable[DateTime]]$until);
($content + $engine) `
$replacements = @{
"moonheart08" = "moony"
}
$ignore = @{
"PJBot" = $true
}
$engine = & "$PSScriptRoot\dump_commits_since.ps1" -repo space-wizards/RobustToolbox -since $since -until $until
$content = & "$PSScriptRoot\dump_commits_since.ps1" -repo space-wizards/space-station-14 -since $since -until $until
$contribs = ($content + $engine) `
| Select-Object -ExpandProperty author `
| Select-Object -ExpandProperty login -Unique `
| Where-Object { -not $ignore[$_] }
| ForEach-Object { $replacements[$_] ?? $_ }
| Sort-Object `
| Join-String -Separator ", "
Write-Host $contribs
Write-Host "Total commit count is $($engine.Length + $content.Length)"