Merge pull request #1639 from laurentsimon/release/generic

OSSF SLSA generic generator
This commit is contained in:
Sampark Sharma
2022-09-06 16:49:25 +05:30
committed by GitHub
3 changed files with 86 additions and 0 deletions
@@ -0,0 +1,68 @@
# 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 generate SLSA provenance file for your project.
# The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements
# 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 generic generator
on:
workflow_dispatch:
release:
types: [created]
permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
outputs:
digests: ${{ steps.hash.outputs.digests }}
steps:
- uses: actions/checkout@v3
# ========================================================
#
# Step 1: Build your artifacts.
#
# ========================================================
- name: Build artifacts
run: |
# These are some amazing artifacts.
echo "artifact1" > artifact1
echo "artifact2" > artifact2
# ========================================================
#
# Step 2: Add a step to generate the provenance subjects
# as shown below. Update the sha256 sum arguments
# to include all binaries that you generate
# provenance for.
#
# ========================================================
- name: Generate subject
id: hash
run: |
set -euo pipefail
# List the artifacts the provenance will refer to.
files=$(ls artifact*)
# Generate the subjects (base64 encoded).
echo "::set-output name=digests::$(sha256sum $files | base64 -w0)"
provenance:
needs: [build]
permissions:
actions: read # To read the workflow path.
id-token: write # To sign the provenance.
contents: write # To add assets to a release.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.2.0
with:
base64-subjects: "${{ needs.build.outputs.digests }}"
upload-assets: true # Optional: Upload to a new release
@@ -0,0 +1,7 @@
{
"name": "SLSA Generic generator",
"creator": "Open Source Security Foundation (OpenSSF)",
"description": "Generate SLSA3 provenance for your existing release workflows",
"iconName": "generator-generic-ossf-slsa3-publish",
"categories": ["Continuous integration", "Go", "Elixir", "Erlang", "PHP", "Haskell", "Rust", "Java", "Scala", "Gradle", "Maven", "Python", "C", "C++", "TypeScript", "JavaScript", "npm", "Ruby", "HTML", "Composer", "Makefile", "Ada"]
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg fill="none" version="1.1" viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-31)" clip-path="url(#a)">
<path d="m161.53 3.0994e-5 0.385-0.43543-7.493-6.6222-3.311 3.7465c-0.989 1.1184-1.991 2.2222-3.008 3.3111h-117.1v7.7919l-6.8799 4.2403 2.6234 4.2565c1.3735 2.2285 2.7929 4.4196 4.2565 6.5724v93.421c-0.0339 1e-3 -0.0678 1e-3 -0.1018 2e-3l-4.9989 0.102 0.2035 9.998 4.8972-0.1v13.716h140v-88.684c1.44-2.0734 2.84-4.183 4.196-6.3282 2.279-3.4292 3.971-6.3613 5.103-8.4579 0.57-1.054 0.998-1.8986 1.29-2.4912 0.146-0.2964 0.258-0.5299 0.336-0.6953 0.039-0.0827 0.069-0.1484 0.091-0.1964l0.027-0.0587 9e-3 -0.0192 3e-3 -0.0071 1e-3 -0.0029 1e-3 -0.0013c0-6e-4 0-0.0011-4.557-2.0578l4.557 2.0567 2.057-4.5575-9.115-4.1132-2.054 4.5518v1e-3l-1e-3 9e-4 -1e-3 0.0017v2e-3l-8e-3 0.0174c-0.011 0.0234-0.03 0.0642-0.057 0.1216-0.054 0.115-0.141 0.2967-0.261 0.5399-0.239 0.4866-0.611 1.2188-1.116 2.155-0.155 0.2859-0.322 0.5907-0.501 0.9131v-32.69zm0 0h-13.427c-22.046 23.618-50.591 40.246-81.991 47.779-11.875-10.541-22.305-22.871-30.851-36.737l-2.6234-4.2565-1.6331 1.0065v15.069c8.7076 12.807 18.982 24.259 30.482 34.156 16.53 14.226 35.591 25.242 56.17 32.461-17.424 11.387-36.962 19.448-57.612 23.605-9.4774 1.907-19.19 2.992-29.04 3.199v10.002l0.1018-2e-3c10.484-0.213 20.823-1.365 30.911-3.396 25.403-5.113 49.217-15.796 69.786-31.09 15.01-11.161 28.292-24.779 39.201-40.48v-18.626c-0.996 1.7908-2.38 4.127-4.163 6.808l-0.033 0.0491-0.031 0.0498c-10.512 16.639-23.759 31.015-38.962 42.68-18.881-5.709-36.555-14.758-52.18-26.662 31.982-9.1292 60.827-27.25 82.969-52.304z" clip-rule="evenodd" fill="#f03100" fill-rule="evenodd"/>
</g>
<defs>
<clipPath id="a">
<path d="m31 28c0-15.464 12.536-28 28-28h84c15.464 0 28 12.536 28 28v84c0 15.464-12.536 28-28 28h-84c-15.464 0-28-12.536-28-28z" fill="#fff"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB