[macos] Add sudo to SBOM generation (#7759)

This commit is contained in:
Shamil Mubarakshin
2023-06-21 10:16:01 +02:00
committed by GitHub
parent a9bb38099f
commit 2fdd5e58c2

View File

@@ -4,9 +4,8 @@ name: Create and upload a SBOM to release assets
# github.event.client_payload.ReleaseID - Current release ID # github.event.client_payload.ReleaseID - Current release ID
# github.event.client_payload.imageVersion - AzDO image version "major.minor" # github.event.client_payload.imageVersion - AzDO image version "major.minor"
# github.event.client_payload.ReleaseBranchName - Necessary to identify workflow run # github.event.client_payload.ReleaseBranchName - Necessary to identify workflow run
# #
# Current SYFT tool issues: # Current SYFT tool issues:
# macOS (minor): very long cataloging process (more than 6 hours) (https://github.com/anchore/syft/issues/1328),
# macOS (major): prompt privilegies that blocking process indefinetely (https://github.com/anchore/syft/issues/1367) # macOS (major): prompt privilegies that blocking process indefinetely (https://github.com/anchore/syft/issues/1367)
on: on:
repository_dispatch: repository_dispatch:
@@ -36,7 +35,7 @@ jobs:
- name: Install SYFT tool on Ubuntu or macOS - name: Install SYFT tool on Ubuntu or macOS
if: ${{ runner.os != 'Windows' }} if: ${{ runner.os != 'Windows' }}
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
#Running section. #Running section.
- name: Run SYFT on Windows - name: Run SYFT on Windows
if: ${{ runner.os == 'Windows' }} if: ${{ runner.os == 'Windows' }}
run: D:/syft/syft dir:C:/ -vv -o spdx-json=sbom.json run: D:/syft/syft dir:C:/ -vv -o spdx-json=sbom.json
@@ -45,7 +44,7 @@ jobs:
run: syft dir:/ -vv -o spdx-json=sbom.json run: syft dir:/ -vv -o spdx-json=sbom.json
- name: Run SYFT on macOS - name: Run SYFT on macOS
if: ${{ runner.os == 'macOS' }} if: ${{ runner.os == 'macOS' }}
run: syft dir:/ -vv -o spdx-json=sbom.json --exclude ./Users --exclude ./System/Volumes --exclude ./private run: sudo syft dir:/ -vv -o spdx-json=sbom.json --exclude ./Users --exclude ./System/Volumes --exclude ./private
shell: bash shell: bash
#Preparing artifact (raw SBOM.json is too big) #Preparing artifact (raw SBOM.json is too big)
- name: Compress SBOM file - name: Compress SBOM file