Skip to content

Commit

Permalink
fix: update docker-based workflow name to container-based
Browse files Browse the repository at this point in the history
Signed-off-by: Asra Ali <[email protected]>
  • Loading branch information
asraa committed May 29, 2023
1 parent 319a01f commit e1ecdc2
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 26 deletions.
1 change: 1 addition & 0 deletions .github/configs-docker/multi-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Produces multiple artifacts, in nested paths.
5 changes: 5 additions & 0 deletions .github/configs-docker/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Test "build" scripts that puts a few artifacts in a dist/** folder
mkdir dist/foo
echo "artifact1" > dist/artifact1
echo "artifact2" > dist/artifact2
echo "artifact3" > dist/foo/artifact3
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
id-token: write # For signing
actions: read
contents: write # For asset uploads
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: "bash"
builder-digest: "sha256:9e2ba52487d945504d250de186cb4fe2e3ba023ed2921dd6ac8b97ed43e76af9"
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

if-succeeded:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id-token: write # For signing
actions: read
contents: write # For asset uploads
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: "bash"
builder-digest: "sha256:9e2ba52487d945504d250de186cb4fe2e3ba023ed2921dd6ac8b97ed43e76af9"
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

if-succeeded:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
schedule:
# Twice a month scheduled cron for rebuilding the base builder image.
- cron: "0 3 1,15 * *"
# Verify docker-based workflow with the base builder image daily.
# Verify container-based workflow with the base builder image daily.
- cron: "0 3 * * *"
workflow_dispatch:
inputs:
Expand All @@ -22,7 +22,7 @@ env:

PROVENANCE_NAME: attestation.intoto

IMAGE_NAME: slsa-tooling/example-package-repo/e2e.docker-based.schedule.main.gcp-workload-identity.slsa3
IMAGE_NAME: slsa-tooling/example-package-repo/e2e.container-based.schedule.main.gcp-workload-identity.slsa3
IMAGE_REGISTRY: us-west2-docker.pkg.dev
SERVICE_ACCOUNT: [email protected]
PROVIDER_NAME: projects/819720953812/locations/global/workloadIdentityPools/example-package-pool/providers/example-package-provider
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
actions: read
contents: write # For asset uploads
needs: [base]
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: ${{ needs.base.outputs.image }}
builder-digest: ${{ needs.base.outputs.digest }}
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

if-succeeded:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
target: [foo, bar]
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: "bash"
builder-digest: "sha256:9e2ba52487d945504d250de186cb4fe2e3ba023ed2921dd6ac8b97ed43e76af9"
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

# if-succeeded:
# runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
IMAGE_REGISTRY: ghcr.io
# NOTE: We reuse the registry-username test image.
# The image name should be of the form: slsa-framework/example-package.<test name>
IMAGE_NAME: slsa-framework/example-package.e2e.docker-based.schedule.main.registry-username.slsa3
IMAGE_NAME: slsa-framework/example-package.e2e.container-based.schedule.main.registry-username.slsa3

REGISTRY_USERNAME: asraa
REGISTRY_PASSWORD: ${{ secrets.E2E_DOCKER_TOKEN }}
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
actions: read
contents: write # For asset uploads
needs: [base]
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: ${{ needs.base.outputs.image }}
builder-digest: ${{ needs.base.outputs.digest }}
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

if-succeeded:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
schedule:
# Twice a month scheduled cron for rebuilding the base builder image.
- cron: "0 3 1,15 * *"
# Verify docker-based workflow with the base builder image daily.
# Verify container-based workflow with the base builder image daily.
- cron: "0 3 * * *"
workflow_dispatch:
inputs:
Expand All @@ -26,7 +26,7 @@ env:
# NOTE: This pushes a container image to a "package" under the
# slsa-framework GitHub org.
# The image name should be of the form: slsa-framework/example-package.<test name>
IMAGE_NAME: slsa-framework/example-package.e2e.docker-based.schedule.main.registry-username.slsa3
IMAGE_NAME: slsa-framework/example-package.e2e.container-based.schedule.main.registry-username.slsa3

REGISTRY_USERNAME: asraa
REGISTRY_PASSWORD: ${{ secrets.E2E_DOCKER_TOKEN }}
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
actions: read
contents: write # For asset uploads
needs: [base]
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: ${{ needs.base.outputs.image }}
builder-digest: ${{ needs.base.outputs.digest }}
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

if-succeeded:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
id-token: write # For signing
actions: read
contents: write # For asset uploads
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: "bash"
builder-digest: "sha256:9e2ba52487d945504d250de186cb4fe2e3ba023ed2921dd6ac8b97ed43e76af9"
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

if-succeeded:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
id-token: write # For signing
actions: read
contents: write # For asset uploads
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@main
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@main
with:
builder-image: "bash"
builder-digest: "sha256:9e2ba52487d945504d250de186cb4fe2e3ba023ed2921dd6ac8b97ed43e76af9"
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- env:
BINARY: ${{ steps.build.outputs.name }}
PROVENANCE: attestation.intoto.sigstore
run: ./.github/workflows/scripts/e2e.docker-based.default.verify.sh
run: ./.github/workflows/scripts/e2e.container-based.default.verify.sh

if-succeeded:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/e2e-verify.common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ get_builder_id() {
"container")
builder_id="https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/heads/main"
;;
"docker-based")
builder_id="https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@refs/heads/main"
"container-based")
builder_id="https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@refs/heads/main"
;;
"nodejs")
builder_id="https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@refs/heads/main"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# shellcheck source=/dev/null
source "./.github/workflows/scripts/e2e-verify.common.sh"

# verify_provenance_content verifies provenance content generated by the docker-based generator.
# verify_provenance_content verifies provenance content generated by the container-based generator.
verify_provenance_content() {
# This is always in sigstore bundle format.
ATTESTATION=$(jq -r '.dsseEnvelope.payload' <"$PROVENANCE" | base64 -d)
Expand All @@ -17,7 +17,7 @@ verify_provenance_content() {
e2e_verify_common_all_v1 "$ATTESTATION"

e2e_verify_predicate_subject_name "$ATTESTATION" "$BINARY"
e2e_verify_predicate_v1_runDetails_builder_id "$ATTESTATION" "https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_docker-based_slsa3.yml@refs/heads/main"
e2e_verify_predicate_v1_runDetails_builder_id "$ATTESTATION" "https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@refs/heads/main"
e2e_verify_predicate_v1_buildDefinition_buildType "$ATTESTATION" "https://slsa.dev/container-based-build/v0.1?draft"

# Ignore tha annotated tags, because they are not part of a release.
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
fmt.Println("GitCommit:", gitCommit)
fmt.Println("Hello world:", uuidWithoutHyphen)

// To test the docker-based builder workflows, this App may also create a file with
// To test the container-based builder workflows, this App may also create a file with
// specified contents if provided any filename arguments.
flag.Var(&filenameFlags, "filename", "a filename to write out")
content := flag.String("content", "default", "content to write to the file")
Expand Down

0 comments on commit e1ecdc2

Please sign in to comment.