Skip to content

Commit b1046c7

Browse files
committed
makes output file available to calling workflow
1 parent 2b14da5 commit b1046c7

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

actions/socket-export-sbom/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ jobs:
4949
export_env: false
5050

5151
- name: Export SBOM from Socket
52-
uses: ./socket-sbom
52+
id: export-sbom
53+
uses: grafana/shared-workflows/actions/socket-export-sbom@socket-export-sbom/v0.1.0
5354
with:
5455
socket_api_token: ${{ fromJSON(steps.vault-secrets.outputs.secrets).SOCKET_API_TOKEN }}
5556
output_file: ${{ inputs.output_file }}
5657

5758
- name: Upload SBOM artifact
58-
uses: actions/upload-artifact@v4
59+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5960
with:
6061
name: "sbom"
61-
path: socket-sbom/${{ inputs.output_file }}
62+
path: ${{ steps.export-sbom.outputs.path }}
6263
retention-days: 30
6364
```
6465

actions/socket-export-sbom/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ inputs:
1717
description: "Name of the file to save the sbom"
1818
required: false
1919

20+
outputs:
21+
path:
22+
description: "Path to the exported sbom file"
23+
value: ${{ steps.export-sbom.outputs.path }}
24+
2025
runs:
2126
using: "composite"
2227
steps:
@@ -33,6 +38,7 @@ runs:
3338
echo "name=$REPO_NAME" >> $GITHUB_OUTPUT
3439
3540
- name: Export SPDX SBOM from Socket.dev
41+
id: export-sbom
3642
shell: bash
3743
env:
3844
SOCKET_API_TOKEN: ${{ inputs.socket_api_token }}
@@ -47,4 +53,4 @@ runs:
4753
OUTPUT_FILE=$(basename "$OUTPUT_FILE")
4854
fi
4955
go run main.go $REPO_NAME $OUTPUT_FILE
50-
echo "ACTION_PATH/$OUTPUT_FILE" >> $GITHUB_OUTPUT
56+
echo "path=ACTION_PATH/$OUTPUT_FILE" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)