Use Forgejo single-commit route and validate release publisher in CI
All checks were successful
Release AstroFrame / packages (push) Successful in 56s
All checks were successful
Release AstroFrame / packages (push) Successful in 56s
This commit is contained in:
parent
51fab803b3
commit
0a6476d428
4 changed files with 5 additions and 3 deletions
|
|
@ -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)) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue