slsa-github-generator
slsa-github-generator copied to clipboard
Get repository, ref via Github API
Currently we have to have special case code to run e2e tests in pull requests due to #131. I'd like to get rid of that code so that pull requests run normally.
I want to see if I can't get the repository and ref via the Github API rather than by creating an OIDC token. Creating an OIDC token requires id-token scope which is not normally given to workflows triggered by the pull_request event.
This wouldn't allow us to sign using sigstore's Github provider, but it would at least solve the problem of getting the reusable workflow repo and ref.
This was done and can be closed?
No, this is just an idea I had that I wanted to get the repo and ref via the GitHub API instead of by using job_workflow_ref an OIDC token. I'm not sure it's really possible. It's more of a refactor than a feature and it's not really high priority.
ho right, my bad.
Update here: detect-workflow-js works this way so the remaining item here is to (after ensuring some stability in that new action) to deprecate detect-workflow and replace with detect-workflow-js
The old detect-workflow action was removed in #1988 and detect-workflow-js does this already. Closing.
https://github.com/slsa-framework/slsa-github-generator/blob/f8e470688f4d6523b8afa65618cf5e8a1183fcf4/.github/actions/detect-workflow-js/src/main.ts#L42-L60
This issue was reopened by the todo-issue-reopener action in the "TODO Issue Reopener" GitHub Actions workflow because there are TODOs referencing this issue:
- internal/builders/container/generate.go:55: Remove
- internal/builders/container/generate.go:63: Remove
- internal/builders/generic/attest.go:87: Remove
- internal/builders/generic/attest.go:95: Remove
- internal/builders/go/pkg/provenance.go:129: Remove
- internal/builders/go/pkg/provenance.go:139: Remove
- internal/builders/go/pkg/provenance_test.go:26: Remove
So I think the issue is that this is fixed for detect-workflow-js but we only use that for our pre-BYOB builders/generators that were written in Go in order to detect which repo/ref to checkout in order to build the builder binary for pre-submits/e2e tests.
We still need to update the pre-BYOB builder code itself to clean up how we deal with pre-submits and e2e tests.