Skip to content

Commit 20fe716

Browse files
CopilotthomasneubergerCopilot
authored
CD workflow: generate SBOM artifact with least-privilege permissions (#62)
* Initial plan * feat: generate SBOM and attach as artifact in CD workflow Co-authored-by: thomasneuberger <23504477+thomasneuberger@users.noreply.github.com> Agent-Logs-Url: https://github.com/thomasneuberger/TgHomeBot/sessions/919dae8a-b9a6-479b-8135-ed4e6160e078 * Add artifact write permission Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Pin action to SHA Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: remove unneeded id-token and attestations write permissions from CD workflow Co-authored-by: thomasneuberger <23504477+thomasneuberger@users.noreply.github.com> Agent-Logs-Url: https://github.com/thomasneuberger/TgHomeBot/sessions/520c83c2-8c1a-4670-ac3e-6cc2fd1abb96 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thomasneuberger <23504477+thomasneuberger@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 99c5e06 commit 20fe716

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/cd.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
permissions:
1818
contents: read
1919
packages: write
20+
actions: write
2021

2122
steps:
2223
- uses: actions/checkout@v4
@@ -54,5 +55,13 @@ jobs:
5455
tags: ${{ steps.metaApi.outputs.tags }}
5556
labels: ${{ steps.metaApi.outputs.labels }}
5657

58+
- name: Generate SBOM
59+
uses: anchore/sbom-action@0c39f226e1aa89d60625e475bb6270a458861361
60+
with:
61+
image: ${{ env.REGISTRY }}/thomasneuberger/tghomebot-api:${{ steps.imageTag.outputs.tag }}
62+
artifact-name: sbom-${{ steps.imageTag.outputs.tag }}.spdx.json
63+
output-file: sbom.spdx.json
64+
format: spdx-json
65+
5766
- name: Output image tag
5867
run: echo "Image tag ${{ steps.imageTag.outputs.tag }} published" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)