-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from interlynk-io/surendrapathak-patch-5
sbomgr SBOM push workflow
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and Push SBOM to Interlynk | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build-sbom: | ||
name: SBOM build and Push to Platform | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Download syft binary | ||
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin | ||
- name: Run syft | ||
run: syft version | ||
- name: Get Tag | ||
id: get_tag | ||
run: echo "tag=$(git describe --tags HEAD)" > $GITHUB_ENV | ||
- name: Build SBOM | ||
run: | | ||
syft --source-name 'sbomqs' --source-version ${{ env.tag }} --exclude ./public -o cyclonedx-json --file sbomqs.cdx.json . | ||
- name: Upload SBOM | ||
run: | | ||
curl -v "https://api.interlynk.io/lynkapi" \ | ||
-H "Authorization: Bearer ${{ secrets.INTERLYNK_SECURITY_TOKEN }}" \ | ||
-F 'operations={"query":"mutation uploadSbom($doc: Upload!, $projectId: ID!) { sbomUpload(input: { doc: $doc, projectId: $projectId }) { errors } }","variables":{"doc":null,"projectId": "${{ vars.INTERLYNK_PRODUCT_ID }}" }}' \ | ||
-F 'map={"0":["variables.doc"]}' \ | ||
-F '0=@"sbomqs.cdx.json";type=application/json' |