mirror of
https://github.com/actions/runner-images.git
synced 2025-12-30 13:58:18 +08:00
Fix SBOM workflow logic (#8848)
* Fix SBOM workflow logic * Revert SYFT pinning for Windows
This commit is contained in:
12
.github/workflows/create_sbom_report.yml
vendored
12
.github/workflows/create_sbom_report.yml
vendored
@@ -15,7 +15,7 @@ defaults:
|
||||
shell: pwsh
|
||||
jobs:
|
||||
#Checking image version on available runner
|
||||
version-check:
|
||||
building-sbom:
|
||||
runs-on: ${{ github.event.client_payload.agentSpec }}
|
||||
steps:
|
||||
- name: Available image version check for ${{ github.event.client_payload.ReleaseBranchName }}
|
||||
@@ -26,15 +26,9 @@ jobs:
|
||||
if ("$imageMajorVersion.$imageMinorVersion" -ne '${{ github.event.client_payload.imageVersion }}') {
|
||||
throw "Current runner $imageMajorVersion.$imageMinorVersion image version doesn't match ${{ github.event.client_payload.imageVersion }}."
|
||||
}
|
||||
#Install and run SYFT, compress SBOM, upload it to release assets
|
||||
create-sbom:
|
||||
needs: version-check
|
||||
runs-on: ${{ github.event.client_payload.agentSpec }}
|
||||
steps:
|
||||
#Installation section
|
||||
- name: Install SYFT tool on Windows
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b D:/syft v0.84.1
|
||||
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b D:/syft
|
||||
- name: Install SYFT tool on Ubuntu or macOS
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
|
||||
@@ -68,4 +62,4 @@ jobs:
|
||||
upload_url: "https://uploads.github.com/repos/actions/runner-images/releases/${{ github.event.client_payload.ReleaseID }}/assets{?name,label}"
|
||||
asset_path: ./sbom.json.zip
|
||||
asset_name: sbom.${{ github.event.client_payload.agentSpec }}.json.zip
|
||||
asset_content_type: application/zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
Reference in New Issue
Block a user