Skip to content

Commit 2e71058

Browse files
chore(NODE-6212): generate sarif report and upload sbom file to s3 (#178)
1 parent 658c858 commit 2e71058

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/release.yml

+74
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,77 @@ jobs:
2727
run: npm publish --provenance
2828
env:
2929
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
31+
generate_sarif_report:
32+
environment: release
33+
runs-on: ubuntu-latest
34+
needs: [release_please]
35+
permissions:
36+
# required for all workflows
37+
security-events: write
38+
id-token: write
39+
contents: write
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Set up drivers-github-tools
44+
uses: mongodb-labs/drivers-github-tools/setup@v2
45+
with:
46+
aws_region_name: us-east-1
47+
aws_role_arn: ${{ secrets.aws_role_arn }}
48+
aws_secret_id: ${{ secrets.aws_secret_id }}
49+
50+
- name: "Generate Sarif Report"
51+
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
52+
with:
53+
ref: main
54+
output-file: sarif-report.json
55+
56+
- name: Get release version and release package file name
57+
id: get_version
58+
shell: bash
59+
run: |
60+
package_version=$(jq --raw-output '.version' package.json)
61+
echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
62+
63+
- name: actions/publish_asset_to_s3
64+
uses: mongodb-labs/drivers-github-tools/node/publish_asset_to_s3@v2
65+
with:
66+
version: ${{ steps.get_version.outputs.package_version }}
67+
product_name: node-kerberos
68+
file: sarif-report.json
69+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
70+
71+
upload_sbom_lite:
72+
environment: release
73+
runs-on: ubuntu-latest
74+
needs: [release_please]
75+
permissions:
76+
# required for all workflows
77+
security-events: write
78+
id-token: write
79+
contents: write
80+
81+
steps:
82+
- uses: actions/checkout@v4
83+
- name: Set up drivers-github-tools
84+
uses: mongodb-labs/drivers-github-tools/setup@v2
85+
with:
86+
aws_region_name: us-east-1
87+
aws_role_arn: ${{ secrets.aws_role_arn }}
88+
aws_secret_id: ${{ secrets.aws_secret_id }}
89+
90+
- name: Get release version and release package file name
91+
id: get_version
92+
shell: bash
93+
run: |
94+
package_version=$(jq --raw-output '.version' package.json)
95+
echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
96+
97+
- name: actions/publish_asset_to_s3
98+
uses: mongodb-labs/drivers-github-tools/node/publish_asset_to_s3@v2
99+
with:
100+
version: ${{ steps.get_version.outputs.package_version }}
101+
product_name: node-kerberos
102+
file: sbom.json
103+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}

0 commit comments

Comments
 (0)