File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -830,6 +830,17 @@ def _verify_identity(args: argparse.Namespace) -> None:
830
830
def _verify_github (args : argparse .Namespace ) -> None :
831
831
inner_policies : list [policy .VerificationPolicy ] = []
832
832
833
+ # We require at least one of `--cert-identity` or `--repository`,
834
+ # to minimize the risk of user confusion about what's being verified.
835
+ if not (args .cert_identity or args .workflow_repository ):
836
+ _die (args , "--cert-identity or --repository is required" )
837
+
838
+ # No matter what the user configures above, we require the OIDC issuer to
839
+ # be GitHub Actions.
840
+ inner_policies .append (
841
+ policy .OIDCIssuer ("https://token.actions.githubusercontent.com" )
842
+ )
843
+
833
844
if args .cert_identity :
834
845
inner_policies .append (
835
846
policy .Identity (
@@ -850,16 +861,6 @@ def _verify_github(args: argparse.Namespace) -> None:
850
861
if args .workflow_ref :
851
862
inner_policies .append (policy .GitHubWorkflowRef (args .workflow_ref ))
852
863
853
- if not inner_policies :
854
- _die (args , "No verification options supplied" )
855
-
856
- # No matter what the user configures above, we require the OIDC issuer to
857
- # be GitHub Actions. We add this below the check above, since it doesn't
858
- # constitute a sufficient policy check on its own.
859
- inner_policies .append (
860
- policy .OIDCIssuer ("https://token.actions.githubusercontent.com" )
861
- )
862
-
863
864
policy_ = policy .AllOf (inner_policies )
864
865
865
866
verifier , materials = _collect_verification_state (args )
You can’t perform that action at this time.
0 commit comments