Skip to content

Commit

Permalink
conftest: tweak _has_oidc_id to only check our repo (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw authored Dec 2, 2024
1 parent acb4ecf commit 435a8d2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ def _has_oidc_id():
# On GitHub Actions, forks do not have access to OIDC identities.
# We differentiate this case from other GitHub credential errors,
# since it's a case where we want to skip (i.e. return False).
if os.getenv("GITHUB_EVENT_NAME") == "pull_request":
#
# We also skip when the repo isn't our own, since downstream
# regression testers (e.g. PyCA Cryptography) don't necessarily
# want to give our unit tests access to an OIDC identity.
if (
os.getenv("GITHUB_REPOSITORY") != "sigstore/sigstore-python"
or os.getenv("GITHUB_EVENT_NAME") == "pull_request"
):
return False
return True
except AmbientCredentialError:
Expand Down

0 comments on commit 435a8d2

Please sign in to comment.