Skip to content

Commit 63b9475

Browse files
committed
Update contribute.py
1 parent 7ab5505 commit 63b9475

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

contribute.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ def remove_prefix(text, prefix):
103103

104104
# Decode Github Token
105105
def decode_token(encoded_token):
106-
decoded_bytes = base64.b64decode(encoded_token.encode('utf-8'))
107-
decoded_token = decoded_bytes.decode('utf-8')
106+
decoded_bytes = encoded_token.encode("ascii")
107+
convertedbytes = base64.b64decode(decoded_bytes)
108+
decoded_token = convertedbytes.decode("ascii")
109+
print('token decoded successfully')
108110
return decoded_token
109111

110112

@@ -156,6 +158,7 @@ def decode_token(encoded_token):
156158
if isImageFile(filename):
157159
with open(path, 'rb') as file:
158160
image = file.read()
161+
print('image processing')
159162
content = base64.b64encode(image).decode('utf-8')
160163
else:
161164
with open(path, 'r') as file:
@@ -166,5 +169,6 @@ def decode_token(encoded_token):
166169
commitAndUpdateRef(repo,tree_content,base_ref.commit,branch)
167170
runWorkflow(repo,upstream_repo)
168171
except Exception as e:
172+
print(e)
169173
print("Some error Occured.Please try again after some time.",end="")
170174
exit(0)

0 commit comments

Comments
 (0)