One more fix to the build system - skip actions

This commit is contained in:
Sebastien L
2022-11-28 09:52:24 -05:00
parent 14f4caf584
commit f15f846030

View File

@@ -214,7 +214,8 @@ def format_commit(commit):
dt = datetime.fromtimestamp(float(commit.author.time), timezone( dt = datetime.fromtimestamp(float(commit.author.time), timezone(
timedelta(minutes=commit.author.offset))) timedelta(minutes=commit.author.offset)))
timestr = dt.strftime('%c%z') timestr = dt.strftime('%c%z')
cmesg = commit.message.replace('\n', ' ') cmesg:str = commit.message.replace('\n', ' ')
cmesg = cmesg.replace('*','-')
return f'{commit.short_id} {cmesg} ({timestr}) <{commit.author.name}>'.replace(' ', ' ', ) return f'{commit.short_id} {cmesg} ({timestr}) <{commit.author.name}>'.replace(' ', ' ', )
@@ -524,7 +525,7 @@ class Releases():
print(f'Opening repository from {path}') print(f'Opening repository from {path}')
cls.repo = Repository(path=path) cls.repo = Repository(path=path)
except GitError as ex: except GitError as ex:
print_error(f"Unable to access the repository({ex}).\nContent of {path}:\n{NEWLINE_CHAR.join(get_file_list(path, 1))}") Logger.error(f"Unable to access the repository({ex}).\nContent of {path}:\n{Logger.NEWLINE_CHAR.join(get_file_list(path, 1))}")
raise raise
return cls.repo return cls.repo
@@ -863,7 +864,7 @@ def push_with_method(auth_method:str,token:str,remote: Remote,reference):
remote.push(reference, callbacks=RemoteCallbacks(pygit2.UserPass(auth_method, token))) remote.push(reference, callbacks=RemoteCallbacks(pygit2.UserPass(auth_method, token)))
success=True success=True
except Exception as ex: except Exception as ex:
print_error(f'Error pushing with auth method {auth_method}: {ex}.') Logger.error(f'Error pushing with auth method {auth_method}: {ex}.')
return success return success
def push_if_change(repo: Repository, token: str, source_path: str, manif_json): def push_if_change(repo: Repository, token: str, source_path: str, manif_json):
@@ -883,12 +884,12 @@ def push_if_change(repo: Repository, token: str, source_path: str, manif_json):
print( print(
f'Pushing commit {format_commit(repo[commit])} to url {origin.url}') f'Pushing commit {format_commit(repo[commit])} to url {origin.url}')
remote: Remote = repo.remotes['origin'] remote: Remote = repo.remotes['origin']
# remote.credentials = credentials auth_methods = ['x-access-token','x-oauth-basic']
auth_method = 'x-access-token' for method in auth_methods:
remote.push([reference], callbacks=RemoteCallbacks( if push_with_method('x-access-token', token, remote, [reference]):
pygit2.UserPass(auth_method, token))) print(f'::notice Web installer updated for {format_artifact_from_manifest(manif_json)}')
print( return
f'::notice Web installer updated for {format_artifact_from_manifest(manif_json)}')
else: else:
print(f'WARNING: No change found. Skipping update') print(f'WARNING: No change found. Skipping update')