File tree 2 files changed +10
-5
lines changed 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 37
37
_SUMMARY = Path (_summary_path ).open ("a" )
38
38
39
39
_RENDER_SUMMARY = os .getenv ("GHA_SIGSTORE_PYTHON_SUMMARY" , "true" ) == "true"
40
- _DEBUG = os .getenv ("GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG" , "false" ) != "false"
40
+ _INTERNAL_DEBUG = os .getenv ("GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG" , "false" ) != "false"
41
+ _GHA_STEP_DEBUG = os .getenv ("ACTIONS_STEP_DEBUG" , "false" ) == "true"
41
42
42
43
_RELEASE_SIGNING_ARTIFACTS = (
43
44
os .getenv ("GHA_SIGSTORE_PYTHON_RELEASE_SIGNING_ARTIFACTS" , "true" ) == "true"
@@ -56,8 +57,10 @@ def _summary(msg):
56
57
57
58
58
59
def _debug (msg ):
59
- if _DEBUG :
60
+ if _INTERNAL_DEBUG :
60
61
print (f"\033 [93mDEBUG: { msg } \033 [0m" , file = sys .stderr )
62
+ elif _GHA_STEP_DEBUG :
63
+ print (f"::debug::{ msg } " , file = sys .stderr )
61
64
62
65
63
66
def _log (msg ):
@@ -131,7 +134,7 @@ def _fatal_help(msg):
131
134
# to upload these as workflow artifacts after signing.
132
135
signing_artifact_paths = []
133
136
134
- if _DEBUG :
137
+ if _INTERNAL_DEBUG or _GHA_STEP_DEBUG :
135
138
sigstore_python_env ["SIGSTORE_LOGLEVEL" ] = "DEBUG"
136
139
137
140
identity_token = os .getenv ("GHA_SIGSTORE_PYTHON_IDENTITY_TOKEN" )
Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ die() {
22
22
}
23
23
24
24
debug () {
25
- if [[ " ${GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG} " = " true" ]]; then
26
- echo -e " \033[93mDEBUG: ${1} \033[0m"
25
+ if [[ " ${GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG} " == " true" ]]; then
26
+ echo -e " \033[93mDEBUG: ${1} \033[0m" >&2
27
+ elif [[ " ${ACTIONS_STEP_DEBUG} " == ' true' ]]; then
28
+ echo " ::debug::${* } " >&2
27
29
fi
28
30
}
29
31
You can’t perform that action at this time.
0 commit comments