renovate 42.19.9 → 42.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/config/migrate-validate.js +1 -2
  2. package/dist/config/migrate-validate.js.map +1 -1
  3. package/dist/config/migration.js +0 -1
  4. package/dist/config/migration.js.map +1 -1
  5. package/dist/config/options/index.js +1 -1
  6. package/dist/config/options/index.js.map +1 -1
  7. package/dist/instrumentation/index.js +3 -4
  8. package/dist/instrumentation/index.js.map +1 -1
  9. package/dist/modules/datasource/crate/index.js +1 -1
  10. package/dist/modules/datasource/crate/index.js.map +1 -1
  11. package/dist/modules/datasource/docker/common.js +6 -0
  12. package/dist/modules/datasource/docker/common.js.map +1 -1
  13. package/dist/modules/datasource/docker/schema.js +1 -1
  14. package/dist/modules/datasource/docker/schema.js.map +1 -1
  15. package/dist/modules/datasource/go/index.js +1 -2
  16. package/dist/modules/datasource/go/index.js.map +1 -1
  17. package/dist/modules/datasource/maven/index.js +2 -2
  18. package/dist/modules/datasource/maven/index.js.map +1 -1
  19. package/dist/modules/datasource/maven/util.js +2 -2
  20. package/dist/modules/datasource/maven/util.js.map +1 -1
  21. package/dist/modules/manager/bazel/artifacts.js +2 -2
  22. package/dist/modules/manager/bazel/artifacts.js.map +1 -1
  23. package/dist/modules/manager/maven-wrapper/artifacts.js +2 -2
  24. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  25. package/dist/modules/manager/npm/extract/common/package-file.js +2 -2
  26. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  27. package/dist/modules/manager/npm/extract/yarn.js +2 -2
  28. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  29. package/dist/modules/manager/npm/post-update/index.js +14 -18
  30. package/dist/modules/manager/npm/post-update/index.js.map +1 -1
  31. package/dist/modules/manager/npm/post-update/npm.js +4 -4
  32. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  33. package/dist/modules/manager/npm/post-update/pnpm.js +4 -4
  34. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  35. package/dist/modules/manager/npm/post-update/yarn.js +6 -6
  36. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  37. package/dist/modules/manager/npm/update/dependency/index.js +3 -4
  38. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  39. package/dist/modules/manager/npm/update/dependency/pnpm.js +2 -2
  40. package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
  41. package/dist/modules/manager/npm/update/index.js +1 -0
  42. package/dist/modules/manager/npm/update/index.js.map +1 -1
  43. package/dist/modules/manager/npm/update/locked-dependency/common/parent-version.js +8 -8
  44. package/dist/modules/manager/npm/update/locked-dependency/common/parent-version.js.map +1 -1
  45. package/dist/modules/manager/npm/update/locked-dependency/package-lock/dep-constraints.js +2 -2
  46. package/dist/modules/manager/npm/update/locked-dependency/package-lock/dep-constraints.js.map +1 -1
  47. package/dist/modules/manager/npm/update/locked-dependency/package-lock/index.js +5 -5
  48. package/dist/modules/manager/npm/update/locked-dependency/package-lock/index.js.map +1 -1
  49. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/get-locked.js +4 -4
  50. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/get-locked.js.map +1 -1
  51. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/index.js +2 -2
  52. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/index.js.map +1 -1
  53. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/replace.js +2 -2
  54. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/replace.js.map +1 -1
  55. package/dist/modules/manager/npm/update/package-version/index.js +1 -2
  56. package/dist/modules/manager/npm/update/package-version/index.js.map +1 -1
  57. package/dist/modules/manager/npm/utils.js +8 -8
  58. package/dist/modules/manager/npm/utils.js.map +1 -1
  59. package/dist/modules/platform/azure/azure-helper.js +2 -2
  60. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  61. package/dist/modules/platform/azure/index.js +14 -14
  62. package/dist/modules/platform/azure/index.js.map +1 -1
  63. package/dist/modules/platform/bitbucket/comments.js +4 -4
  64. package/dist/modules/platform/bitbucket/comments.js.map +1 -1
  65. package/dist/modules/platform/bitbucket/index.js +31 -31
  66. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  67. package/dist/modules/platform/bitbucket/utils.js +2 -2
  68. package/dist/modules/platform/bitbucket/utils.js.map +1 -1
  69. package/dist/modules/platform/bitbucket-server/index.js +32 -34
  70. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  71. package/dist/modules/platform/bitbucket-server/utils.js +2 -4
  72. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  73. package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
  74. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  75. package/dist/modules/platform/codecommit/index.js +24 -24
  76. package/dist/modules/platform/codecommit/index.js.map +1 -1
  77. package/dist/modules/platform/forgejo/forgejo-helper.d.ts +1 -0
  78. package/dist/modules/platform/forgejo/forgejo-helper.js +26 -0
  79. package/dist/modules/platform/forgejo/forgejo-helper.js.map +1 -1
  80. package/dist/modules/platform/forgejo/index.js +35 -20
  81. package/dist/modules/platform/forgejo/index.js.map +1 -1
  82. package/dist/modules/platform/gitea/index.js +4 -4
  83. package/dist/modules/platform/gitea/index.js.map +1 -1
  84. package/dist/modules/platform/github/index.js +68 -68
  85. package/dist/modules/platform/github/index.js.map +1 -1
  86. package/dist/modules/platform/github/massage-markdown-links.js +2 -2
  87. package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
  88. package/dist/modules/platform/github/pr.js +2 -2
  89. package/dist/modules/platform/github/pr.js.map +1 -1
  90. package/dist/modules/platform/github/schema.js +1 -2
  91. package/dist/modules/platform/github/schema.js.map +1 -1
  92. package/dist/modules/platform/gitlab/index.js +29 -30
  93. package/dist/modules/platform/gitlab/index.js.map +1 -1
  94. package/dist/modules/platform/utils/pr-body.js +7 -3
  95. package/dist/modules/platform/utils/pr-body.js.map +1 -1
  96. package/dist/proxy.js +1 -2
  97. package/dist/proxy.js.map +1 -1
  98. package/dist/util/cache/package/index.js +2 -2
  99. package/dist/util/cache/package/index.js.map +1 -1
  100. package/dist/util/cache/package/namespaces.js +1 -1
  101. package/dist/util/cache/package/namespaces.js.map +1 -1
  102. package/dist/util/cache/repository/types.d.ts +1 -0
  103. package/dist/util/cache/repository/types.js.map +1 -1
  104. package/dist/util/git/error.js +5 -4
  105. package/dist/util/git/error.js.map +1 -1
  106. package/dist/util/git/index.js +10 -12
  107. package/dist/util/git/index.js.map +1 -1
  108. package/dist/util/git/private-key.js +2 -0
  109. package/dist/util/git/private-key.js.map +1 -1
  110. package/dist/util/http/bitbucket.js +1 -2
  111. package/dist/util/http/bitbucket.js.map +1 -1
  112. package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
  113. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  114. package/dist/util/http/http.js +1 -1
  115. package/dist/util/http/http.js.map +1 -1
  116. package/dist/util/stats.js +1 -1
  117. package/dist/util/stats.js.map +1 -1
  118. package/dist/workers/global/config/parse/codespaces.js +1 -2
  119. package/dist/workers/global/config/parse/codespaces.js.map +1 -1
  120. package/dist/workers/repository/update/branch/auto-replace.js +4 -2
  121. package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
  122. package/dist/workers/repository/update/branch/automerge.js +4 -1
  123. package/dist/workers/repository/update/branch/automerge.js.map +1 -1
  124. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +1 -0
  125. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  126. package/dist/workers/repository/update/branch/index.js +16 -8
  127. package/dist/workers/repository/update/branch/index.js.map +1 -1
  128. package/package.json +3 -2
  129. package/renovate-schema.json +3 -3
@@ -32,8 +32,9 @@ function checkForPlatformFailure(err) {
32
32
  logger_1.logger.debug({ err }, 'Converting git error to ExternalHostError');
33
33
  return new external_host_error_1.ExternalHostError(err, 'git');
34
34
  }
35
- /* v8 ignore start -- TODO: add test */
35
+ /* v8 ignore next -- TODO: add test */
36
36
  }
37
+ /* v8 ignore next -- TODO: add test */
37
38
  const configErrorStrings = [
38
39
  {
39
40
  error: 'GitLab: Branch name does not follow the pattern',
@@ -56,6 +57,7 @@ function checkForPlatformFailure(err) {
56
57
  message: "Renovate cannot push branches if there are tags with names the same as Renovate's branches. Please remove conflicting tag names or change Renovate's branchPrefix to avoid conflicts.",
57
58
  },
58
59
  ];
60
+ /* v8 ignore next -- TODO: add test */
59
61
  for (const { error, message } of configErrorStrings) {
60
62
  if (err.message.includes(error)) {
61
63
  logger_1.logger.debug({ err }, 'Converting git error to CONFIG_VALIDATION error');
@@ -65,10 +67,10 @@ function checkForPlatformFailure(err) {
65
67
  return res;
66
68
  }
67
69
  }
70
+ /* v8 ignore next -- TODO: add test */
68
71
  return null;
69
72
  }
70
- /* v8 ignore stop */
71
- /* v8 ignore start -- TODO: add tests */
73
+ /* v8 ignore next -- TODO: add tests */
72
74
  function handleCommitError(err, branchName, files) {
73
75
  checkForPlatformFailure(err);
74
76
  if (err.message.includes(`'refs/heads/renovate' exists`)) {
@@ -119,7 +121,6 @@ function handleCommitError(err, branchName, files) {
119
121
  // We don't know why this happened, so this will cause bubble up to a branch error
120
122
  throw err;
121
123
  }
122
- /* v8 ignore stop */
123
124
  function bulkChangesDisallowed(err) {
124
125
  return err.message.includes('update more than');
125
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../lib/util/git/error.ts"],"names":[],"mappings":";;AAMA,0DAkEC;AAID,8CAkEC;AAGD,sDAEC;AAnJD,mEAAmE;AACnE,yCAAsC;AACtC,gFAA2E;AAC3E,gCAAgC;AAGhC,SAAgB,uBAAuB,CAAC,GAAU;IAChD,IAAI,IAAA,YAAM,GAAE,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,0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,GAAG,+EAA+E,CAAC;QAC1G,MAAM,KAAK,CAAC;IACd,CAAC;IACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,gCAAgC,CAAC,CAAC;IACxD,kFAAkF;IAClF,MAAM,GAAG,CAAC;AACZ,CAAC;AACD,oBAAoB;AAEpB,SAAgB,qBAAqB,CAAC,GAAU;IAC9C,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import { CONFIG_VALIDATION } from '../../constants/error-messages';\nimport { logger } from '../../logger';\nimport { ExternalHostError } from '../../types/errors/external-host-error';\nimport { getEnv } from '../env';\nimport type { FileChange } from './types';\n\nexport function checkForPlatformFailure(err: Error): Error | null {\n if (getEnv().NODE_ENV === 'test') {\n return null;\n }\n const externalHostFailureStrings = [\n 'remote: Invalid username or password',\n 'gnutls_handshake() failed',\n 'The requested URL returned error: 403',\n 'The requested URL returned error: 5',\n 'The remote end hung up unexpectedly',\n 'access denied or repository not exported',\n 'Could not write new index file',\n 'Failed to connect to',\n 'Connection timed out',\n 'malformed object name',\n 'Could not resolve host',\n 'early EOF',\n 'fatal: bad config', // .gitmodules problem\n 'expected flush after ref listing',\n ];\n for (const errorStr of externalHostFailureStrings) {\n if (err.message.includes(errorStr)) {\n logger.debug({ err }, 'Converting git error to ExternalHostError');\n return new ExternalHostError(err, 'git');\n }\n /* v8 ignore start -- TODO: add test */\n }\n\n const configErrorStrings = [\n {\n error: 'GitLab: Branch name does not follow the pattern',\n message:\n \"Cannot push because branch name does not follow project's push rules\",\n },\n {\n error: 'GitLab: Commit message does not follow the pattern',\n message:\n \"Cannot push because commit message does not follow project's push rules\",\n },\n {\n error: ' is not a member of team',\n message:\n 'The `Restrict commits to existing GitLab users` rule is blocking Renovate push. Check the Renovate `gitAuthor` setting',\n },\n {\n error: 'TF401027:',\n message:\n 'You need the Git `GenericContribute` permission to perform this action',\n },\n {\n error: 'matches more than one',\n message:\n \"Renovate cannot push branches if there are tags with names the same as Renovate's branches. Please remove conflicting tag names or change Renovate's branchPrefix to avoid conflicts.\",\n },\n ];\n for (const { error, message } of configErrorStrings) {\n if (err.message.includes(error)) {\n logger.debug({ err }, 'Converting git error to CONFIG_VALIDATION error');\n const res = new Error(CONFIG_VALIDATION);\n res.validationError = message;\n res.validationMessage = `\\`${err.message.replaceAll('`', \"'\")}\\``;\n return res;\n }\n }\n\n return null;\n}\n/* v8 ignore stop */\n\n/* v8 ignore start -- TODO: add tests */\nexport function handleCommitError(\n err: Error,\n branchName: string,\n files?: FileChange[],\n): null {\n checkForPlatformFailure(err);\n if (err.message.includes(`'refs/heads/renovate' exists`)) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = 'None';\n error.validationError = 'An existing branch is blocking Renovate';\n error.validationMessage = `Renovate needs to create the branch \\`${branchName}\\` but is blocked from doing so because of an existing branch called \\`renovate\\`. Please remove it so that Renovate can proceed.`;\n throw error;\n }\n if (\n err.message.includes(\n 'refusing to allow a GitHub App to create or update workflow',\n )\n ) {\n logger.warn(\n 'App has not been granted permissions to update Workflows - aborting branch.',\n );\n return null;\n }\n if (\n (err.message.includes('remote rejected') || err.message.includes('403')) &&\n files?.some((file) => file.path?.startsWith('.github/workflows/'))\n ) {\n logger.debug({ err }, 'commitFiles error');\n logger.info('Workflows update rejection - aborting branch.');\n return null;\n }\n if (err.message.includes('protected branch hook declined')) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = branchName;\n error.validationError = 'Renovate branch is protected';\n error.validationMessage = `Renovate cannot push to its branch because branch protection has been enabled.`;\n throw error;\n }\n if (err.message.includes('can only push your own commits')) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = branchName;\n error.validationError = 'Bitbucket committer error';\n error.validationMessage = `Renovate has experienced the following error when attempting to push its branch to the server: \\`${err.message.replaceAll(\n '`',\n \"'\",\n )}\\``;\n throw error;\n }\n if (err.message.includes('remote: error: cannot lock ref')) {\n logger.error({ err }, 'Error committing files.');\n return null;\n }\n if (\n err.message.includes('denying non-fast-forward') ||\n err.message.includes('GH003: Sorry, force-pushing')\n ) {\n logger.debug({ err }, 'Permission denied to update branch');\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = branchName;\n error.validationError = 'Force push denied';\n error.validationMessage = `Renovate is unable to update branch(es) due to force pushes being disallowed.`;\n throw error;\n }\n logger.debug({ err }, 'Unknown error committing files');\n // We don't know why this happened, so this will cause bubble up to a branch error\n throw err;\n}\n/* v8 ignore stop */\n\nexport function bulkChangesDisallowed(err: Error): boolean {\n return err.message.includes('update more than');\n}\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../lib/util/git/error.ts"],"names":[],"mappings":";;AAMA,0DAqEC;AAGD,8CAkEC;AAED,sDAEC;AApJD,mEAAmE;AACnE,yCAAsC;AACtC,gFAA2E;AAC3E,gCAAgC;AAGhC,SAAgB,uBAAuB,CAAC,GAAU;IAChD,IAAI,IAAA,YAAM,GAAE,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,0BAA0B,GAAG;QACjC,sCAAsC;QACtC,2BAA2B;QAC3B,uCAAuC;QACvC,qCAAqC;QACrC,qCAAqC;QACrC,0CAA0C;QAC1C,gCAAgC;QAChC,sBAAsB;QACtB,sBAAsB;QACtB,uBAAuB;QACvB,wBAAwB;QACxB,WAAW;QACX,mBAAmB,EAAE,sBAAsB;QAC3C,kCAAkC;KACnC,CAAC;IACF,KAAK,MAAM,QAAQ,IAAI,0BAA0B,EAAE,CAAC;QAClD,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,2CAA2C,CAAC,CAAC;YACnE,OAAO,IAAI,uCAAiB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;QACD,sCAAsC;I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A2B,CAAC;QACpD,KAAK,CAAC,iBAAiB,GAAG,oGAAoG,GAAG,CAAC,OAAO,CAAC,UAAU,CAClJ,GAAG,EACH,GAAG,CACJ,IAAI,CAAC;QACN,MAAM,KAAK,CAAC;IACd,CAAC;IACD,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,EAAE,CAAC;QAC3D,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,yBAAyB,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IACE,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAChD,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAAC,EACnD,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oCAAoC,CAAC,CAAC;QAC5D,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,kCAAiB,CAAC,CAAC;QAC3C,KAAK,CAAC,gBAAgB,GAAG,UAAU,CAAC;QACpC,KAAK,CAAC,eAAe,GAAG,mBAAmB,CAAC;QAC5C,KAAK,CAAC,iBAAiB,GAAG,+EAA+E,CAAC;QAC1G,MAAM,KAAK,CAAC;IACd,CAAC;IACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,gCAAgC,CAAC,CAAC;IACxD,kFAAkF;IAClF,MAAM,GAAG,CAAC;AACZ,CAAC;AAED,SAAgB,qBAAqB,CAAC,GAAU;IAC9C,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import { CONFIG_VALIDATION } from '../../constants/error-messages';\nimport { logger } from '../../logger';\nimport { ExternalHostError } from '../../types/errors/external-host-error';\nimport { getEnv } from '../env';\nimport type { FileChange } from './types';\n\nexport function checkForPlatformFailure(err: Error): Error | null {\n if (getEnv().NODE_ENV === 'test') {\n return null;\n }\n const externalHostFailureStrings = [\n 'remote: Invalid username or password',\n 'gnutls_handshake() failed',\n 'The requested URL returned error: 403',\n 'The requested URL returned error: 5',\n 'The remote end hung up unexpectedly',\n 'access denied or repository not exported',\n 'Could not write new index file',\n 'Failed to connect to',\n 'Connection timed out',\n 'malformed object name',\n 'Could not resolve host',\n 'early EOF',\n 'fatal: bad config', // .gitmodules problem\n 'expected flush after ref listing',\n ];\n for (const errorStr of externalHostFailureStrings) {\n if (err.message.includes(errorStr)) {\n logger.debug({ err }, 'Converting git error to ExternalHostError');\n return new ExternalHostError(err, 'git');\n }\n /* v8 ignore next -- TODO: add test */\n }\n\n /* v8 ignore next -- TODO: add test */\n const configErrorStrings = [\n {\n error: 'GitLab: Branch name does not follow the pattern',\n message:\n \"Cannot push because branch name does not follow project's push rules\",\n },\n {\n error: 'GitLab: Commit message does not follow the pattern',\n message:\n \"Cannot push because commit message does not follow project's push rules\",\n },\n {\n error: ' is not a member of team',\n message:\n 'The `Restrict commits to existing GitLab users` rule is blocking Renovate push. Check the Renovate `gitAuthor` setting',\n },\n {\n error: 'TF401027:',\n message:\n 'You need the Git `GenericContribute` permission to perform this action',\n },\n {\n error: 'matches more than one',\n message:\n \"Renovate cannot push branches if there are tags with names the same as Renovate's branches. Please remove conflicting tag names or change Renovate's branchPrefix to avoid conflicts.\",\n },\n ];\n /* v8 ignore next -- TODO: add test */\n for (const { error, message } of configErrorStrings) {\n if (err.message.includes(error)) {\n logger.debug({ err }, 'Converting git error to CONFIG_VALIDATION error');\n const res = new Error(CONFIG_VALIDATION);\n res.validationError = message;\n res.validationMessage = `\\`${err.message.replaceAll('`', \"'\")}\\``;\n return res;\n }\n }\n\n /* v8 ignore next -- TODO: add test */\n return null;\n}\n\n/* v8 ignore next -- TODO: add tests */\nexport function handleCommitError(\n err: Error,\n branchName: string,\n files?: FileChange[],\n): null {\n checkForPlatformFailure(err);\n if (err.message.includes(`'refs/heads/renovate' exists`)) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = 'None';\n error.validationError = 'An existing branch is blocking Renovate';\n error.validationMessage = `Renovate needs to create the branch \\`${branchName}\\` but is blocked from doing so because of an existing branch called \\`renovate\\`. Please remove it so that Renovate can proceed.`;\n throw error;\n }\n if (\n err.message.includes(\n 'refusing to allow a GitHub App to create or update workflow',\n )\n ) {\n logger.warn(\n 'App has not been granted permissions to update Workflows - aborting branch.',\n );\n return null;\n }\n if (\n (err.message.includes('remote rejected') || err.message.includes('403')) &&\n files?.some((file) => file.path?.startsWith('.github/workflows/'))\n ) {\n logger.debug({ err }, 'commitFiles error');\n logger.info('Workflows update rejection - aborting branch.');\n return null;\n }\n if (err.message.includes('protected branch hook declined')) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = branchName;\n error.validationError = 'Renovate branch is protected';\n error.validationMessage = `Renovate cannot push to its branch because branch protection has been enabled.`;\n throw error;\n }\n if (err.message.includes('can only push your own commits')) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = branchName;\n error.validationError = 'Bitbucket committer error';\n error.validationMessage = `Renovate has experienced the following error when attempting to push its branch to the server: \\`${err.message.replaceAll(\n '`',\n \"'\",\n )}\\``;\n throw error;\n }\n if (err.message.includes('remote: error: cannot lock ref')) {\n logger.error({ err }, 'Error committing files.');\n return null;\n }\n if (\n err.message.includes('denying non-fast-forward') ||\n err.message.includes('GH003: Sorry, force-pushing')\n ) {\n logger.debug({ err }, 'Permission denied to update branch');\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = branchName;\n error.validationError = 'Force push denied';\n error.validationMessage = `Renovate is unable to update branch(es) due to force pushes being disallowed.`;\n throw error;\n }\n logger.debug({ err }, 'Unknown error committing files');\n // We don't know why this happened, so this will cause bubble up to a branch error\n throw err;\n}\n\nexport function bulkChangesDisallowed(err: Error): boolean {\n return err.message.includes('update more than');\n}\n"]}
@@ -130,7 +130,7 @@ async function getDefaultBranch(git) {
130
130
  // see https://stackoverflow.com/a/62352647/3005034
131
131
  try {
132
132
  let res = await git.raw(['rev-parse', '--abbrev-ref', 'origin/HEAD']);
133
- /* v8 ignore start -- TODO: add test */
133
+ /* v8 ignore next -- TODO: add test */
134
134
  if (!res) {
135
135
  logger_1.logger.debug('Could not determine default branch using git rev-parse');
136
136
  const headPrefix = 'HEAD branch: ';
@@ -140,9 +140,8 @@ async function getDefaultBranch(git) {
140
140
  .find((line) => line.startsWith(headPrefix))
141
141
  .replace(headPrefix, '');
142
142
  }
143
- /* v8 ignore stop */
144
143
  return res.replace('origin/', '').trim();
145
- /* v8 ignore start -- TODO: add test */
144
+ /* v8 ignore next -- TODO: add test */
146
145
  }
147
146
  catch (err) {
148
147
  logger_1.logger.debug({ err }, 'Error getting default branch');
@@ -159,7 +158,6 @@ async function getDefaultBranch(git) {
159
158
  }
160
159
  throw err;
161
160
  }
162
- /* v8 ignore stop */
163
161
  }
164
162
  let config = {};
165
163
  // TODO: can be undefined
@@ -389,7 +387,7 @@ async function syncGit() {
389
387
  const durationMs = Math.round(Date.now() - fetchStart);
390
388
  logger_1.logger.info({ durationMs }, 'git fetch completed');
391
389
  clone = false;
392
- /* v8 ignore next 6 -- TODO: add test */
390
+ /* v8 ignore next -- TODO: add test */
393
391
  }
394
392
  catch (err) {
395
393
  if (err.message === error_messages_1.REPOSITORY_EMPTY) {
@@ -439,7 +437,7 @@ async function syncGit() {
439
437
  }
440
438
  try {
441
439
  config.currentBranchSha = (await git.raw(['rev-parse', 'HEAD'])).trim();
442
- /* v8 ignore next 6 -- TODO: add test */
440
+ /* v8 ignore next -- TODO: add test */
443
441
  }
444
442
  catch (err) {
445
443
  if (err.message?.includes('fatal: not a git repository')) {
@@ -452,7 +450,7 @@ async function syncGit() {
452
450
  try {
453
451
  const latestCommit = (await git.log({ n: 1 })).latest;
454
452
  logger_1.logger.debug({ latestCommit }, 'latest repository commit');
455
- /* v8 ignore next 10 -- TODO: add test */
453
+ /* v8 ignore next -- TODO: add test */
456
454
  }
457
455
  catch (err) {
458
456
  const errChecked = (0, error_1.checkForPlatformFailure)(err);
@@ -749,7 +747,7 @@ async function isBranchConflicted(baseBranch, branch) {
749
747
  }
750
748
  catch (err) {
751
749
  result = true;
752
- /* v8 ignore next 6 -- TODO: add test */
750
+ /* v8 ignore next -- TODO: add test */
753
751
  if (!err?.git?.conflicts?.length) {
754
752
  logger_1.logger.debug({ baseBranch, branch, err }, 'isBranchConflicted: unknown error');
755
753
  }
@@ -760,7 +758,7 @@ async function isBranchConflicted(baseBranch, branch) {
760
758
  if (origBranch !== baseBranch) {
761
759
  await git.checkout(origBranch);
762
760
  }
763
- /* v8 ignore next 6 -- TODO: add test */
761
+ /* v8 ignore next -- TODO: add test */
764
762
  }
765
763
  catch (err) {
766
764
  logger_1.logger.debug({ baseBranch, branch, err }, 'isBranchConflicted: cleanup error');
@@ -1120,7 +1118,7 @@ async function commitFiles(commitConfig) {
1120
1118
  }
1121
1119
  }
1122
1120
  return null;
1123
- /* v8 ignore next 6 -- TODO: add test */
1121
+ /* v8 ignore next -- TODO: add test */
1124
1122
  }
1125
1123
  catch (err) {
1126
1124
  if (err.message.includes('[rejected] (stale info)')) {
@@ -1322,9 +1320,9 @@ async function getRemotes() {
1322
1320
  logger_1.logger.debug(`Found remotes: ${remotes.map((r) => r.name).join(', ')}`);
1323
1321
  return remotes.map((remote) => remote.name);
1324
1322
  }
1325
- catch (err) /* v8 ignore start */ {
1323
+ catch (err) /* v8 ignore next */ {
1326
1324
  logger_1.logger.error({ err }, 'Error getting remotes');
1327
1325
  throw err;
1328
- } /* v8 ignore stop */
1326
+ }
1329
1327
  }
1330
1328
  //# sourceMappingURL=index.js.map