diff --git a/lib/create-branch.js b/lib/create-branch.js index 308a6cbb..3cd12687 100644 --- a/lib/create-branch.js +++ b/lib/create-branch.js @@ -118,7 +118,7 @@ module.exports = async ( /* This is the structure of the tokens 'model' - _id: `${installationId} + _id: `${accountId} tokens: { ${repoId}: { npm: ${token}, @@ -129,7 +129,7 @@ module.exports = async ( let execTokens = '' let repositoryTokens = '' try { - repositoryTokens = await tokens.get(installationId) + repositoryTokens = await tokens.get(repoDoc.accountId) } catch (error) { log.error(`Unable to get repository token`, { lockfilePath, error }) } diff --git a/test/lib/create-branch.js b/test/lib/create-branch.js index 4fba66cf..991a5bbe 100644 --- a/test/lib/create-branch.js +++ b/test/lib/create-branch.js @@ -1429,7 +1429,7 @@ describe('create branch with lockfiles', async () => { test('change one file (package.json) and generate its lockfile with tokens', async () => { const { tokens, 'token-audits': tokenAudits } = await dbs() // eslint-disable-line await tokens.put({ - _id: '123', + _id: '124', tokens: { 'one-lockfile-with-token': { npm: '12345',