diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts index 1533d7ab2870ee9d6feaa9026b02273e96d0f0f2..0450a4c20f69834d3d2723a20af24e8ee09847a7 100644 --- a/lib/platform/github/index.ts +++ b/lib/platform/github/index.ts @@ -324,7 +324,7 @@ export async function initRepo({ try { await githubApi.postJson(`repos/${config.repository}/git/refs`, { body, - token: forkToken || opts.token, + token: forkToken, }); logger.debug('Created new default branch in fork'); } catch (err) /* istanbul ignore next */ { @@ -334,7 +334,7 @@ export async function initRepo({ ); } else { logger.warn( - { err }, + { err, body: err.response?.body }, 'Could not create parent defaultBranch in fork' ); } @@ -348,6 +348,7 @@ export async function initRepo({ name: config.repository.split('/')[1], default_branch: config.defaultBranch, }, + token: forkToken, }); logger.debug('Successfully changed default branch for fork'); } catch (err) /* istanbul ignore next */ {