Skip to content

Commit 925cd0b

Browse files
Reject existing release retry ownership conflicts
1 parent d06a877 commit 925cd0b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎.github/actions/Release-PSModule/src/release.ps1‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ Set-GitHubLogGroup 'Create GitHub release' {
244244
if ($releaseExists -and $null -eq $tagCommit) {
245245
throw "Existing release [$releaseTag] has no verifiable tag. Refusing to resume."
246246
}
247+
if ($releaseExists) {
248+
$owner = Get-PSModulePrereleaseOwnership -Body $existingRelease.body
249+
if ($null -ne $owner -and ($owner.Repository -ine $env:GITHUB_REPOSITORY -or
250+
$owner.PullRequest -ne $prNumber -or $owner.CommitSha -cne $sourceCommit)) {
251+
throw 'The existing release ownership footer conflicts with the producing repository, pull request, or source.'
252+
}
253+
}
247254
}
248255

249256
if (-not $releaseExists) {

0 commit comments

Comments
 (0)