Skip to content

Commit 4c21280

Browse files
committed
FreeSWITCH CI: Mask the nonce in logs
1 parent a8f591b commit 4c21280

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/actions/repo-auth-client/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ runs:
6262
f"https://${{ inputs.domain }}/auth.php", session
6363
)
6464
65+
if not nonce:
66+
print("Error: Received empty nonce from server")
67+
sys.exit(1)
68+
69+
# Mask the nonce in logs to prevent exposure
70+
print(f'::add-mask::{nonce}')
71+
print("Nonce retrieved and masked successfully")
72+
6573
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
6674
f.write(f'nonce={nonce}\n')
6775
except Exception as e:
@@ -106,6 +114,14 @@ runs:
106114
f'https://${{ inputs.domain }}/?{urlencode({"verify": "${{ env.NONCE }}"})}', session
107115
)
108116
117+
if not token:
118+
print("Error: Received empty token from server")
119+
sys.exit(1)
120+
121+
# Mask the token in logs to prevent exposure
122+
print(f'::add-mask::{token}')
123+
print("Token issued and masked successfully")
124+
109125
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
110126
f.write(f'token={token}\n')
111127
except Exception as e:

0 commit comments

Comments
 (0)