2.14.0 #95
Workflow file for this run
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
name: Dependencies and Licenses | |
on: | |
release: | |
types: | |
- published | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
generate-dependencies: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Core Repo | |
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b #v4.1.5 | |
- name: Set up Go | |
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 #v5.0.1 | |
with: | |
go-version: '~1.22' | |
- name: Install go-licence-detector | |
run: | | |
go install go.elastic.co/[email protected] | |
- name: Clean Go mod | |
run: go mod tidy | |
- name: Generate Dependencies and Licenses | |
run: go list -m -json all | go-licence-detector -includeIndirect -depsTemplate=.dependencies/templates/dependencies.csv.tmpl -depsOut=dependencies-and-licenses.txt | |
- name: Upload dependencies and licenses artifact | |
run: | | |
curl --request POST "https://uploads.github.com/repos/Dynatrace/dynatrace-configuration-as-code/releases/${{ github.event.release.id }}/assets?name=dependencies-and-licenses.txt" \ | |
--header "Accept: application/vnd.github+json" \ | |
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
--header "X-GitHub-Api-Version: 2022-11-28" \ | |
--header "Content-Type: application/octet-stream" \ | |
--fail \ | |
--data-binary @dependencies-and-licenses.txt | |
- name: Install cyclonedx-gomod | |
run: go install github.com/CycloneDX/cyclonedx-gomod/cmd/[email protected] | |
- name: Generate SBOM in CycloneDX format | |
run: cyclonedx-gomod app -licenses -assert-licenses -json -main cmd/monaco/ -output sbom.cdx.json | |
- name: Upload SBOM artifact | |
run: | | |
curl --request POST "https://uploads.github.com/repos/Dynatrace/dynatrace-configuration-as-code/releases/${{ github.event.release.id }}/assets?name=sbom.cdx.json" \ | |
--header "Accept: application/vnd.github+json" \ | |
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
--header "X-GitHub-Api-Version: 2022-11-28" \ | |
--header "Content-Type: application/octet-stream" \ | |
--fail \ | |
--data-binary @sbom.cdx.json |