Skip to content
Snippets Groups Projects
Commit d6e7fe64 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(pr): correct minor -> patch

parent 6f16f1c5
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ const is = require('@sindresorhus/is'); ...@@ -2,6 +2,8 @@ const is = require('@sindresorhus/is');
const handlebars = require('handlebars'); const handlebars = require('handlebars');
const releaseNotesHbs = require('./changelog/hbs-template'); const releaseNotesHbs = require('./changelog/hbs-template');
const versioning = require('../../versioning');
handlebars.registerHelper('encodeURIComponent', encodeURIComponent); handlebars.registerHelper('encodeURIComponent', encodeURIComponent);
module.exports = { module.exports = {
...@@ -47,7 +49,24 @@ async function getPrBody(config) { ...@@ -47,7 +49,24 @@ async function getPrBody(config) {
references.push(`[changelog](${changelogUrl})`); references.push(`[changelog](${changelogUrl})`);
} }
upgrade.references = references.join(', '); upgrade.references = references.join(', ');
const { newValue, newDigestShort, updateType } = upgrade; const {
currentValue,
newValue,
newDigestShort,
updateType,
versionScheme,
} = upgrade;
// istanbul ignore if
if (updateType === 'minor') {
try {
const { getMinor } = versioning(versionScheme);
if (getMinor(currentValue) === getMinor(newValue)) {
upgrade.updateType = 'patch';
}
} catch (err) {
// do nothing
}
}
if (newDigestShort) { if (newDigestShort) {
if (updateType === 'pin') { if (updateType === 'pin') {
upgrade.newValue = config.newDigestShort; upgrade.newValue = config.newDigestShort;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment