mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix: Improve PR body fixes for scoped packages (#569)
Escape all scoped package mentions Escape in group PR bodies too Remove empty repositoryUrl links
This commit is contained in:
parent
6cd398f0c5
commit
f1d7330f2b
5 changed files with 10 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}`depName`{{/if}} from version `{{currentVersion}}` to `{{newVersion}}`{{#if isRollback}}. This is necessary and important because version `{{currentVersion}}` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}`{{depName}}`{{/if}} from version `{{currentVersion}}` to `{{newVersion}}`{{#if isRollback}}. This is necessary and important because version `{{currentVersion}}` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
||||||
{{#if releases.length}}
|
{{#if releases.length}}
|
||||||
|
|
||||||
{{#if schedule}}
|
{{#if schedule}}
|
||||||
|
|
|
@ -5,7 +5,7 @@ This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package grou
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#each upgrades as |upgrade|}}
|
{{#each upgrades as |upgrade|}}
|
||||||
- [{{upgrade.depName}}]({{upgrade.repositoryUrl}}): from `{{upgrade.currentVersion}}` to `{{upgrade.newVersion}}`
|
- {{#if repositoryUrl}}[{{upgrade.depName}}]({{upgrade.repositoryUrl}}){{else}}`{{depName}}`{{/if}}: from `{{upgrade.currentVersion}}` to `{{upgrade.newVersion}}`
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#unless isPin}}
|
{{#unless isPin}}
|
||||||
|
|
|
@ -50,7 +50,10 @@ async function renovatePackage(config) {
|
||||||
// Flatten the result on top of config, add repositoryUrl
|
// Flatten the result on top of config, add repositoryUrl
|
||||||
return results.map(result => {
|
return results.map(result => {
|
||||||
const upg = configParser.mergeChildConfig(config, result);
|
const upg = configParser.mergeChildConfig(config, result);
|
||||||
upg.repositoryUrl = npmDep ? npmDep.repositoryUrl : '';
|
upg.repositoryUrl =
|
||||||
|
npmDep && npmDep.repositoryUrl && npmDep.repositoryUrl.length
|
||||||
|
? npmDep.repositoryUrl
|
||||||
|
: null;
|
||||||
return configParser.filterConfig(upg, 'branch');
|
return configParser.filterConfig(upg, 'branch');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ async function ensurePr(inputConfig, logger, errors, warnings) {
|
||||||
|
|
||||||
const prTitle = handlebars.compile(config.prTitle)(config);
|
const prTitle = handlebars.compile(config.prTitle)(config);
|
||||||
let prBodyMarkdown = handlebars.compile(config.prBody)(config);
|
let prBodyMarkdown = handlebars.compile(config.prBody)(config);
|
||||||
const atUserRe = /@([a-z]+\/[a-z]+)/;
|
const atUserRe = /[^`]@([a-z]+\/[a-z]+)/g;
|
||||||
prBodyMarkdown = prBodyMarkdown.replace(atUserRe, '@​$1');
|
prBodyMarkdown = prBodyMarkdown.replace(atUserRe, '@​$1');
|
||||||
const prBody = converter.makeHtml(prBodyMarkdown);
|
const prBody = converter.makeHtml(prBodyMarkdown);
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ Array [
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#each upgrades as |upgrade|}}
|
{{#each upgrades as |upgrade|}}
|
||||||
- [{{upgrade.depName}}]({{upgrade.repositoryUrl}}): from \`{{upgrade.currentVersion}}\` to \`{{upgrade.newVersion}}\`
|
- {{#if repositoryUrl}}[{{upgrade.depName}}]({{upgrade.repositoryUrl}}){{else}}\`{{depName}}\`{{/if}}: from \`{{upgrade.currentVersion}}\` to \`{{upgrade.newVersion}}\`
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#unless isPin}}
|
{{#unless isPin}}
|
||||||
|
@ -110,7 +110,7 @@ This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](ht
|
||||||
"labels": Array [],
|
"labels": Array [],
|
||||||
"lazyGrouping": true,
|
"lazyGrouping": true,
|
||||||
"message": "Failed to look up dependency",
|
"message": "Failed to look up dependency",
|
||||||
"prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}\`depName\`{{/if}} from version \`{{currentVersion}}\` to \`{{newVersion}}\`{{#if isRollback}}. This is necessary and important because version \`{{currentVersion}}\` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
"prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}\`{{depName}}\`{{/if}} from version \`{{currentVersion}}\` to \`{{newVersion}}\`{{#if isRollback}}. This is necessary and important because version \`{{currentVersion}}\` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
||||||
{{#if releases.length}}
|
{{#if releases.length}}
|
||||||
|
|
||||||
{{#if schedule}}
|
{{#if schedule}}
|
||||||
|
@ -166,7 +166,7 @@ This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](ht
|
||||||
"rebaseStalePrs": false,
|
"rebaseStalePrs": false,
|
||||||
"recreateClosed": false,
|
"recreateClosed": false,
|
||||||
"repoIsOnboarded": true,
|
"repoIsOnboarded": true,
|
||||||
"repositoryUrl": "",
|
"repositoryUrl": null,
|
||||||
"requiredStatusChecks": Array [],
|
"requiredStatusChecks": Array [],
|
||||||
"reviewers": Array [],
|
"reviewers": Array [],
|
||||||
"schedule": "some schedule",
|
"schedule": "some schedule",
|
||||||
|
|
Loading…
Reference in a new issue