mirror of
https://github.com/actions/runner-images.git
synced 2025-12-18 07:46:57 +00:00
Update release variable to use ID instead of branch (#8990)
This commit is contained in:
6
.github/workflows/create_sbom_report.yml
vendored
6
.github/workflows/create_sbom_report.yml
vendored
@@ -24,17 +24,17 @@ jobs:
|
|||||||
id: check
|
id: check
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$apiUrl = "https://api.github.com/repos/actions/runner-images/releases/tags/${{ github.event.client_payload.ReleaseBranchName }}"
|
$apiUrl = "https://api.github.com/repos/actions/runner-images/releases/${{ github.event.client_payload.ReleaseID }}"
|
||||||
$response = Invoke-RestMethod -Uri $apiUrl -Method Get -SkipHttpErrorCheck
|
$response = Invoke-RestMethod -Uri $apiUrl -Method Get -SkipHttpErrorCheck
|
||||||
if ($response.message -ilike "Not Found") {
|
if ($response.message -ilike "Not Found") {
|
||||||
echo "status=release_not_found" >> $env:GITHUB_OUTPUT
|
echo "status=release_not_found" >> $env:GITHUB_OUTPUT
|
||||||
Write-Error "Release for tag ${{ github.event.client_payload.ReleaseBranchName }} wasn't found"
|
Write-Error "Release ${{ github.event.client_payload.ReleaseID }} wasn't found"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
foreach ($asset in $response.assets) {
|
foreach ($asset in $response.assets) {
|
||||||
if ($asset.name -like '*sbom*') {
|
if ($asset.name -like '*sbom*') {
|
||||||
echo "status=sbom_exists" >> $env:GITHUB_OUTPUT
|
echo "status=sbom_exists" >> $env:GITHUB_OUTPUT
|
||||||
return "Release ${{ github.event.client_payload.ReleaseBranchNamen }} already contains a SBOM"
|
return "Release ${{ github.event.client_payload.ReleaseID }} already contains a SBOM"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Host "Release has been found, SBOM is not attached, starting generation."
|
Write-Host "Release has been found, SBOM is not attached, starting generation."
|
||||||
|
|||||||
Reference in New Issue
Block a user