allow testing on PRs

Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
Ramon Petgrave
2025-02-11 13:43:09 -05:00
parent 9825851f50
commit d80909c26a
+5
View File
@@ -5,6 +5,7 @@ import (
"encoding/asn1"
"fmt"
"net/url"
"os"
"strings"
fulcio "github.com/sigstore/fulcio/pkg/certificate"
@@ -175,6 +176,10 @@ func verifyTrustedBuilderRef(id *WorkflowIdentity, ref string) error {
if (id.SourceRepository == trustedBuilderRepository ||
id.SourceRepository == e2eTestRepository) &&
options.TestingEnabled() {
// Allow verification on slsa-github-generator PRs
if testBuilderBranch := os.Getenv("TEST_SLSA_GITHUB_GENERATOR_BRANCH"); strings.Contains(ref, testBuilderBranch) {
return nil
}
// Allow verification on the main branch to support e2e tests.
if ref == "refs/heads/main" {
return nil