Skip to content

Commit 88d111b

Browse files
committed
run compliance steps in the release process
1 parent a6007e9 commit 88d111b

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,46 @@ jobs:
314314
labels: failed-release
315315
title: Publishing v${{ steps.extract-version.outputs.VERSION }} to GitHub Releases failed
316316
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
317+
- name: Generate SBOM
318+
run: |
319+
./scripts/compliance/gen-purls.sh
320+
./scripts/compliance/gen-sbom.sh
321+
- name: Upload SBOM to Kondukto
322+
run: ./scripts/compliance/upload-sbom.sh
323+
env:
324+
KONDUKTO_TOKEN: ${{ secrets.KONDUKTO_TOKEN }}
325+
KONDUKTO_REPO: ${{ vars.KONDUKTO_REPO }}
326+
KONDUKTO_BRANCH_PREFIX: ${{ vars.KONDUKTO_BRANCH_PREFIX }}
327+
- name: terraform-provider-mongodbatlas-checkout
328+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
329+
with:
330+
repository: mongodb/terraform-provider-mongodbatlas
331+
ref: master
332+
- name: Generate SSDLC report
333+
uses: mongodb/terraform-provider-mongodbatlas/.github/templates/run-script-and-commit@master
334+
with:
335+
script_call: |
336+
AUTHOR="${{ github.actor }}"
337+
export AUTHOR
338+
export VERSION=${{ steps.extract-version.outputs.VERSION }}
339+
./scripts/compliance/gen-ssdlc-report.sh
340+
apix_bot_pat: ${{ secrets.APIX_BOT_PAT }}
341+
remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }}
342+
gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }}
343+
passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }}
344+
file_to_commit: 'cfn-resources/${{ github.event.inputs.resourceName }}/compliance/v*/*'
345+
commit_message:
346+
"chore: Update SSDLC report for ${{ needs.publish.outputs.published_version }}"
347+
repo-path: "cfn-resources/"
348+
env:
349+
KONDUKTO_TOKEN: ${{ secrets.KONDUKTO_TOKEN }}
350+
SILKBOMB_IMG: ${{ vars.SILKBOMB_IMG }}
351+
KONDUKTO_REPO: ${{ vars.KONDUKTO_REPO }}
352+
KONDUKTO_BRANCH_PREFIX: ${{ vars.KONDUKTO_BRANCH_PREFIX }}
353+
- name: Upload SBOM as release artifact
354+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
355+
with:
356+
files: compliance/sbom.json
357+
tag_name: ${{ steps.extract-version.outputs.VERSION }}
358+
env:
359+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/compliance/gen-ssdlc-report.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [ -z "${AUTHOR:-}" ]; then
1010
fi
1111

1212
if [ -z "${VERSION:-}" ]; then
13-
VERSION=$(git tag --list 'v*' --sort=-taggerdate | head -1 | cut -d 'v' -f 2)
13+
VERSION=$(git tag --list 'v*' --sort=-v:refname | head -1 | cut -d 'v' -f 2)
1414
fi
1515

1616
if [ "${AUGMENTED_REPORT:-false}" = "true" ]; then

0 commit comments

Comments
 (0)