Skip to content

Commit 6773081

Browse files
DEVOPS-49 fixed variable issue in encrypt secret py code
1 parent abbfd51 commit 6773081

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

encrypt_using_libnacl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ def encrypt(public_key: str, secret_value: str) -> str:
1717
return b64encode(encrypted).decode("utf-8")
1818

1919
def main():
20-
public_key = os.environ.get("PUBLIC_KEY")
20+
repo_public_key = os.environ.get("PUBLIC_KEY")
2121
secret_value = os.environ.get("SECRET_VALUE")
2222
# public_key = "<public key here for local testing>"
2323
# secret_value = "Krishnadhas"
2424

25-
if not (public_key and secret_value):
26-
print("Please set PUBLIC_KEY and SECRET_VALUE environment variables.")
25+
if not (repo_public_key and secret_value):
26+
print("Please set REPOSITORY_PUBLIC_KEY and SECRET_VALUE environment variables.")
2727
exit(1)
2828

2929
try:
30-
encrypted_secret = encrypt(public_key, secret_value)
30+
encrypted_secret = encrypt(repo_public_key, secret_value)
3131
os.system(f'echo "ENCRYPTED_SECRET={encrypted_secret}" >> $GITHUB_ENV')
3232
print(f"Encrypted Secret: {encrypted_secret}")
3333
print(f"Encrypted secret added as a environment variable")

0 commit comments

Comments
 (0)