File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change 10
10
11
11
_GITHUB_STEP_SUMMARY = Path (os .getenv ("GITHUB_STEP_SUMMARY" ))
12
12
13
+ _TOKEN_RETRIEVAL_FAILED_MESSAGE = dedent (
14
+ """
15
+ OIDC token retrieval failed: {identity_error}
16
+
17
+ This generally indicates a workflow configuration error, such as insufficient
18
+ permissions. Make sure that your workflow has `id-token: write` configured
19
+ at either the workflow or job level, e.g.:
20
+
21
+ ```yaml
22
+ permissions:
23
+ id-token: write
24
+ ```
25
+ """
26
+ )
27
+
13
28
14
29
def die (msg : str ) -> NoReturn :
15
30
with _GITHUB_STEP_SUMMARY .open ("a" ) as io :
@@ -75,23 +90,8 @@ def get_normalized_input(name: str) -> str | None:
75
90
76
91
try :
77
92
oidc_token = id .detect_credential (audience = oidc_audience )
78
- except id .IdentityError as exc :
79
- die (
80
- dedent (
81
- f"""
82
- OIDC token retrieval failed: { exc }
83
-
84
- This generally indicates a workflow configuration error, such as insufficient
85
- permissions. Make sure that your workflow has `id-token: write` configured
86
- at either the workflow or job level, e.g.:
87
-
88
- ```yaml
89
- permissions:
90
- id-token: write
91
- ```
92
- """
93
- )
94
- )
93
+ except id .IdentityError as identity_error :
94
+ die (_TOKEN_RETRIEVAL_FAILED_MESSAGE .format (identity_error = identity_error ))
95
95
96
96
# Now we can do the actual token exchange.
97
97
mint_token_resp = requests .post (
You can’t perform that action at this time.
0 commit comments