Skip to content

Commit fbc0895

Browse files
authored
upload sbom with release (#27)
* Create releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml * Update releaser.yaml
1 parent 9004504 commit fbc0895

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/releaser.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: SBOM with tag release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
run_on_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Run script on release
15+
run: |
16+
echo "New release created: ${{ github.event.release.tag_name }}"
17+
# Run your desired script or command here
18+
pip install cyclonedx-bom
19+
cyclonedx-py -r -i ../logicmonitor_data_sdk_py/requirements.txt --format json -o sbom.json
20+
# ls
21+
# - name: Upload a Build Artifact
22+
# uses: actions/upload-artifact@v3.1.2
23+
# with:
24+
# # Artifact name
25+
# name: sbom_report
26+
# # A file, directory or wildcard pattern that describes what to upload
27+
# path: sbom.json
28+
# # - name: release
29+
# uses: actions/create-release@v1
30+
# id: create_release
31+
# with:
32+
# draft: false
33+
# prerelease: false
34+
# release_name: ${{ steps.version.outputs.version }}
35+
# tag_name: ${{ github.ref }}
36+
# #body_path: sbom.json
37+
# env:
38+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Upload files to a GitHub release
41+
uses: svenstaro/upload-release-action@2.5.0
42+
with:
43+
repo_token: ${{ secrets.GITHUB_TOKEN }}
44+
file: sbom.json
45+
asset_name: sbom.json
46+
tag: ${{ github.ref }}
47+
overwrite: true
48+
body: "SBOM for release"
49+
50+
51+

0 commit comments

Comments
 (0)