Skip to content

Commit 3e61005

Browse files
authored
Merge pull request #104 from parteekcoder/contribute_action
Update contribute.py
2 parents 2ac3e87 + 27d5998 commit 3e61005

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

contribute.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def commitAndUpdateRef(repo,tree_content,commit,branch):
5959

6060

6161
def appendBlobInTree(repo,content,file_path,tree_content):
62-
blob = repo.create_git_blob(content,'ascii')
62+
blob = repo.create_git_blob(content,'utf-8')
6363
tree_content.append( github.InputGitTreeElement(path=file_path,mode="100644",type="blob",sha=blob.sha))
6464

6565

@@ -152,6 +152,7 @@ def decode_token(encoded_token):
152152

153153
try:
154154
for root, dirs, files in os.walk(STUDY_NAME_PATH):
155+
files = [f for f in files if not f[0] == '.']
155156
for filename in files:
156157
path = f"{root}/{filename}"
157158
print(path)
@@ -160,7 +161,7 @@ def decode_token(encoded_token):
160161
image = file.read()
161162
content = base64.b64encode(image).decode('utf-8')
162163
else:
163-
with open(file=path, mode='r',encoding='ascii') as file:
164+
with open(file=path, mode='r') as file:
164165
content = file.read()
165166
file_path = f'{DIR_PATH+remove_prefix(path,STUDY_NAME_PATH)}'
166167
if(platform.uname()[0]=='Windows'): file_path=file_path.replace("\\","/")

0 commit comments

Comments
 (0)