Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions contribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ def remove_prefix(text, prefix):

# Decode Github Token
def decode_token(encoded_token):
decoded_bytes = base64.b64decode(encoded_token.encode('utf-8'))
decoded_token = decoded_bytes.decode('utf-8')
decoded_bytes = encoded_token.encode("ascii")
convertedbytes = base64.b64decode(decoded_bytes)
decoded_token = convertedbytes.decode("ascii")
print('token decoded successfully')
return decoded_token


Expand Down Expand Up @@ -156,6 +158,7 @@ def decode_token(encoded_token):
if isImageFile(filename):
with open(path, 'rb') as file:
image = file.read()
print('image processing')
content = base64.b64encode(image).decode('utf-8')
else:
with open(path, 'r') as file:
Expand All @@ -166,6 +169,6 @@ def decode_token(encoded_token):
commitAndUpdateRef(repo,tree_content,base_ref.commit,branch)
runWorkflow(repo,upstream_repo)
except Exception as e:
print("An error encountered: ", end="")
print(e)
print("Some error Occured.Please try again after some time.",end="")
exit(0)