From dfc16b1a396e1bb09adb992b22732404333b0f3e Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Sun, 10 May 2026 14:09:05 +0200 Subject: [PATCH] Avoid redundant updates to GitHub credits --- Tools/contribs_shared.ps1 | 2 ++ Tools/dump_github_contributors.ps1 | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Tools/contribs_shared.ps1 b/Tools/contribs_shared.ps1 index 12340cda70..a59a12d643 100644 --- a/Tools/contribs_shared.ps1 +++ b/Tools/contribs_shared.ps1 @@ -9,6 +9,8 @@ $ignore = @{ "PJBot" = $true + "DeltaV-Bot" = $true # DeltaV GH bot + "pre-commit-ci[bot]" = $true "github-actions[bot]" = $true "ZDDM" = $true "TYoung86" = $true diff --git a/Tools/dump_github_contributors.ps1 b/Tools/dump_github_contributors.ps1 index 288e003337..0fb686ea19 100755 --- a/Tools/dump_github_contributors.ps1 +++ b/Tools/dump_github_contributors.ps1 @@ -14,7 +14,7 @@ function load_contribs([string] $repo) # We use the ?anon=1 query param for reasons explained later. $qParams = @{ "per_page" = 100 - "anon" = 1 + "anon" = true } $headers = @{ @@ -39,7 +39,7 @@ function load_contribs([string] $repo) # GitHub's API, for some reason, has a hard cap on 500 email addresses per repo which it will collate # SS14 has gone past this limit for quite some time, so GitHub will stop including accounts, starting # with those that have lower contributions, as valid distinct users with a `login` field. - # + # # This is obviously a problem. # To remedy, we first use the ?anon=1 parameter to force GitHub to include all committers emails, even # those that it has, in its great and infinite wisdom, chosen to not properly attach to a GitHub account. @@ -63,7 +63,7 @@ function load_contribs([string] $repo) # correctly than not. # 5) Then, we just add a `login` field to our object with their true username and let the rest of the code do its job. - foreach ($contributor in $r) + foreach ($contributor in $r) { if ($null -ne $contributor.name ` -And $null -ne $contributor.email ` @@ -81,7 +81,7 @@ function load_contribs([string] $repo) { continue } - + $contributor | Add-Member -MemberType NoteProperty -Name "login" -Value $username } elseif ($null -eq $contributor.login ` @@ -113,11 +113,11 @@ function load_contribs([string] $repo) } $engineJson = load_contribs("space-wizards/RobustToolbox") -$contentJson = load_contribs("DeltaV-Station/Delta-v-rebase") +$contentJson = load_contribs("DeltaV-Station/Delta-v") ($engineJson).login + ($contentJson).login ` - | select -unique ` + | Select-Object -CaseInsensitive -Unique ` | Where-Object { -not $ignore[$_] }` | ForEach-Object { if($replacements[$_] -eq $null){ $_ } else { $replacements[$_] }} ` - | Sort-object ` - | Join-String -Separator ", " \ No newline at end of file + | Sort-object -CaseSensitive ` + | Join-String -Separator ", "