Skip to content

Add Software Bill Of Materials to release #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions .github/workflows/build-and-sign-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@
name: Build and sign image

on:
pull_request:
types:
- closed
branches:
- "main"

push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build_and_sign_image:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
id-token: write
security-events: write
Expand All @@ -27,6 +23,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: anchore/sbom-action@v0
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
output-file: ./nginx-loadbalancer-kubernetes-${{env.GITHUB_REF_NAME}}.spdx.json
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}

- name: Install cosign
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 #v3.0.2
with:
Expand Down Expand Up @@ -79,3 +82,17 @@ jobs:
sarif_file: 'trivy-results-${{ inputs.image }}.sarif'
sha: ${{ github.sha }}
ref: ${{ github.ref }}

- name: Generate Release
uses: ncipollo/release-action@v1
with:
artifacts: |
trivy-results-${{ inputs.image }}.sarif
./nginx-loadbalancer-kubernetes-${{env.GITHUB_REF_NAME}}.spdx.json
body: |
# Release ${{env.GITHUB_REF_NAME}}
## Changelog
${{ steps.meta.outputs.changelog }}
generateReleaseNotes: true
makeLatest: false
name: "${{env.GITHUB_REF_NAME}}"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: CI
name: Run tests

on:
branch_protection_rule:
types:
- created

push:
branches: [ "main", "*" ]
branches:
- main
- *

jobs:

Expand Down