Files
wwdpublic/Tools/dump_github_contributors.ps1
DEATHB4DEFEAT b58ef2850b Update the Credits Action (#28)
# Description

On a repository (and organization) level, I have enabled Actions to
create and approve pull requests.
This PR will have the in-game GitHub contributor credits automatically
updated every week.
2024-03-22 15:56:22 -04:00

38 lines
906 B
PowerShell
Executable File

#!/usr/bin/env pwsh
$scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. $(join-path $scriptDir contribs_shared.ps1)
function load_contribs([string] $repo)
{
$qParams = @{
"per_page" = 100
}
$url = "https://api.github.com/repos/{0}/contributors" -f $repo
$r = @()
while ($null -ne $url)
{
$resp = Invoke-WebRequest $url -Body $qParams
$url = $resp.RelationLink.next
$j = ConvertFrom-Json $resp.Content
$r += $j
}
return $r
}
$engineJson = load_contribs("space-wizards/RobustToolbox")
$contentJson = load_contribs("Simple-Station/Einstein-Engines")
($engineJson).login + ($contentJson).login `
| select -unique `
| Where-Object { -not $ignore[$_] }`
| ForEach-Object { if($replacements[$_] -eq $null){ $_ } else { $replacements[$_] }} `
| Sort-object `
| Join-String -Separator ", "