Skip to content

Commit

Permalink
Merge pull request ControlCore-Project#99 from parteekcoder/contribut…
Browse files Browse the repository at this point in the history
…e_action

Contribute action
  • Loading branch information
pradeeban authored Aug 4, 2023
2 parents 415452f + 5db7186 commit f4dae88
Showing 1 changed file with 6 additions and 3 deletions.
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)

0 comments on commit f4dae88

Please sign in to comment.