Create go-ossf-slsa3-publish.yml #1
This file contains hidden or 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
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
| # This workflow lets you compile your Go project using a SLSA3 compliant builder. | ||
| # This workflow will generate a so-called "provenance" file describing the steps | ||
| # that were performed to generate the final binary. | ||
| # The project is an initiative of the OpenSSF (openssf.org) and is developed at | ||
| # https://github.com/slsa-framework/slsa-github-generator. | ||
| # The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. | ||
| # For more information about SLSA and how it improves the supply-chain, visit slsa.dev. | ||
| name: SLSA Go releaser | ||
| on: | ||
| workflow_dispatch: | ||
| release: | ||
| types: [created] | ||
| permissions: read-all | ||
| jobs: | ||
| # ======================================================================================================================================== | ||
| # Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project. | ||
| # See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file | ||
| #========================================================================================================================================= | ||
| build: | ||
| permissions: | ||
| id-token: write # To sign. | ||
| contents: write # To upload release assets. | ||
| actions: read # To read workflow path. | ||
| uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
| with: | ||
| go-version: 1.17 | ||
| # ============================================================================================================= | ||
| # Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects | ||
| # ============================================================================================================= | ||
| - uses: actions/attest-build-provenance@v1 | ||
| with: | ||
| # Path to the artifact serving as the subject of the attestation. Must | ||
| # specify exactly one of "subject-path" or "subject-digest". May contain a | ||
| # glob pattern or list of paths (total subject count cannot exceed 2500). | ||
| subject-path: | ||
| # SHA256 digest of the subject for the attestation. Must be in the form | ||
| # "sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one | ||
| # of "subject-path" or "subject-digest". | ||
| subject-digest: | ||
| # Subject name as it should appear in the attestation. Required unless | ||
| # "subject-path" is specified, in which case it will be inferred from the | ||
| # path. | ||
| subject-name: | ||
| # Whether to push the attestation to the image registry. Requires that the | ||
| # "subject-name" parameter specify the fully-qualified image name and that | ||
| # the "subject-digest" parameter be specified. Defaults to false. | ||
| push-to-registry: | ||
| # Whether to attach a list of generated attestations to the workflow run | ||
| # summary page. Defaults to true. | ||
| show-summary: | ||
| # The GitHub token used to make authenticated API requests. Default is | ||
| # ${{ github.token }} | ||
| github-token: | ||