Another friendly public service announcement haha
I got a couple of reports, where the initial pushes to master failed for the following reasons:
- Pushing Github workflows automatically may require that the Token has workflow permissions. This happened suddenly and I don't know the reason for it.
- Github introduced renaming of the main branches and set
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:
- Ensure that your token has workflow permissions. Update yours with
qube config pat
- Replace the pushes to master in github_support.py with
# 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}'
Cheers
Another friendly public service announcement haha
I got a couple of reports, where the initial pushes to master failed for the following reasons:
mainas 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 patReflect this change with the branch protection a little bit below where master is hardcoded and change that to
f'{default_branch}'Cheers