Skip to content

.github/workflows/e2e.go.workflow_dispatch.main.workflow_inputs-noldflags.slsa3.yml #2183

.github/workflows/e2e.go.workflow_dispatch.main.workflow_inputs-noldflags.slsa3.yml

.github/workflows/e2e.go.workflow_dispatch.main.workflow_inputs-noldflags.slsa3.yml #2183

on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
inputs:
test:
description: test
required: false
default: true
permissions: read-all
concurrency: "e2e.go.workflow_dispatch.main.workflow_inputs-noldflags.slsa3"
env:
GH_TOKEN: ${{ secrets.E2E_GO_TOKEN }}
ISSUE_REPOSITORY: slsa-framework/slsa-github-generator
# WARNING: update build job if CONFIG_FILE changes.
CONFIG_FILE: .github/configs-go/config-noldflags.yml
jobs:
dispatch:
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
permissions:
actions: write
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: |
set -euo pipefail
./.github/workflows/scripts/e2e-dispatch.sh
# TODO: support multiple config files.
build:
if: github.event_name == 'workflow_dispatch'
permissions:
id-token: write # For signing.
contents: write # For asset uploads.
actions: read # For the entrypoint.
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@main
with:
go-version: "1.24"
# We cannot use ${{ env.CONFIG_FILE }} because env variables are not available.
config-file: .github/configs-go/config-noldflags.yml
compile-builder: true
verify:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ${{ needs.build.outputs.go-binary-name }}
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ${{ needs.build.outputs.go-binary-name }}.intoto.jsonl
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24"
- env:
BINARY: ${{ needs.build.outputs.go-binary-name }}
# NOTE: we download the artifact as `${{ needs.build.outputs.go-binary-name }}.intoto.jsonl`,
# so we implictely verify that `${{ needs.build.outputs.go-binary-name }}.intoto.jsonl = ${{ needs.build.outputs.go-provenance-name }}`.
PROVENANCE: ${{ needs.build.outputs.go-provenance-name }}
run: ./.github/workflows/scripts/e2e.go.default.verify.sh
if-succeeded:
runs-on: ubuntu-latest
needs: [build, verify]
if: github.event_name == 'workflow_dispatch' && needs.build.result == 'success' && needs.verify.result == 'success'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: ./.github/workflows/scripts/e2e-report-success.sh
if-failed:
runs-on: ubuntu-latest
needs: [build, verify]
if: always() && github.event_name == 'workflow_dispatch' && (needs.build.result == 'failure' || needs.verify.result == 'failure')
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: ./.github/workflows/scripts/e2e-report-failure.sh