Open Zethson opened 3 years ago
Another friendly public service announcement haha
I got a couple of reports, where the initial pushes to master failed for the following reasons:
main
However, pushes to Github always assume that there is a master branch, which may no longer be the case.
Fixes for the issues:
qube config pat
# some descriptive comment headers = {'Authorization': f'token {access_token}'} url = f"https://api.github.com/repos/{creator_ctx.github_username}/{creator_ctx.project_slug}" response = requests.get(url, headers=headers).json() default_branch = response['default_branch'] log.debug(f'git push origin {default_branch}') print(f'[bold blue]Pushing template to Github origin {default_branch}') if default_branch != 'master': cloned_repo.git.branch('-M', f'{default_branch}') cloned_repo.remotes.origin.push(refspec=f'{default_branch}:{default_branch}')
Reflect this change with the branch protection a little bit below where master is hardcoded and change that to f'{default_branch}'
f'{default_branch}'
Cheers
For reference:
https://github.com/mlf-core/mlf-core/commit/8cd90e782b189b6d7e9ee0643df9225b7fa69c4b
Another friendly public service announcement haha
I got a couple of reports, where the initial pushes to master failed for the following reasons:
main
as default. I reverted mine back to master, but not everyone at QBiC may do so.However, pushes to Github always assume that there is a master branch, which may no longer be the case.
Fixes for the issues:
qube config pat
Reflect this change with the branch protection a little bit below where master is hardcoded and change that to
f'{default_branch}'
Cheers