Use Forgejo single-commit route and validate release publisher in CI
All checks were successful
Release AstroFrame / packages (push) Successful in 56s

This commit is contained in:
Elijah 2026-10-03 19:50:21 -07:00
parent 51fab803b3
commit 0a6476d428
4 changed files with 5 additions and 3 deletions

View file

@ -23,7 +23,8 @@ function git {
function Invoke-RestMethod {
param([string]$Uri, [string]$Method='Get', $Headers, [string]$ContentType, [string]$Body, $Form)
$state.Calls++
if ($Uri -match '/commits/') { return @{ sha=('a'*40) } }
# Forgejo's single-commit route is /git/commits/{sha}; /commits/{sha} is a 404.
if ($Method -eq 'Get' -and $Uri -match '/git/commits/[0-9a-f]{40}$') { return @{ sha=('a'*40) } }
if ($Uri -match '/tags/' -and $Uri -notmatch '/releases/tags/') { return @{ commit=@{sha=$state.TagCommit} } }
if ($Uri -match '/releases/tags/') {
if (!$state.Created) { throw [Microsoft.PowerShell.Commands.HttpResponseException]::new('Not found', [Net.Http.HttpResponseMessage]::new([Net.HttpStatusCode]::NotFound)) }