Skip to content

Commit

Permalink
fix(priority): invert semver matching to avoid unfound semver
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonrocha committed Aug 3, 2023
1 parent 645c6a2 commit f663cb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,7 @@ module.exports = async function run({

if (
TARGET !== updateTypes.any &&
updateTypesPriority.indexOf(updateType) >
updateTypesPriority.indexOf(updateType) <
updateTypesPriority.indexOf(TARGET)
) {
core.setOutput(MERGE_STATUS_KEY, MERGE_STATUS.skippedBumpHigherThanTarget)
Expand Down Expand Up @@ -3080,10 +3080,10 @@ const updateTypes = {
}

const updateTypesPriority = [
updateTypes.patch,
updateTypes.minor,
updateTypes.major,
updateTypes.any,
updateTypes.major,
updateTypes.minor,
updateTypes.patch,
]

const mapUpdateType = input => {
Expand Down Expand Up @@ -3314,7 +3314,7 @@ module.exports = require("util");
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.9.0","description":"A GitHub action to automatically merge and approve Dependabot pull requests","main":"src/index.js","scripts":{"build":"ncc build src/index.js","lint":"eslint .","test":"tap test/**.test.js","prepare":"husky install"},"author":{"name":"Salman Mitha","email":"[email protected]"},"contributors":["Simone Busoli <[email protected]>"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/github-action-merge-dependabot.git"},"bugs":{"url":"https://github.com/fastify/github-action-merge-dependabot/issues"},"homepage":"https://github.com/fastify/github-action-merge-dependabot#readme","dependencies":{"@actions/core":"^1.9.1","@actions/github":"^5.1.1","actions-toolkit":"github:nearform/actions-toolkit","gitdiff-parser":"^0.3.1","semver":"^7.5.2"},"devDependencies":{"@vercel/ncc":"^0.36.1","eslint":"^8.43.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","husky":"^8.0.3","prettier":"^2.8.8","proxyquire":"^2.1.3","sinon":"^15.1.2","tap":"^16.3.6"}}');
module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.9.0","description":"A GitHub action to automatically merge and approve Dependabot pull requests","main":"src/index.js","scripts":{"build":"ncc build src/index.js","lint":"eslint .","test":"tap test/**.test.js","prepare":"husky install"},"author":{"name":"Salman Mitha","email":"[email protected]"},"contributors":["Simone Busoli <[email protected]>"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/github-action-merge-dependabot.git"},"bugs":{"url":"https://github.com/fastify/github-action-merge-dependabot/issues"},"homepage":"https://github.com/fastify/github-action-merge-dependabot#readme","dependencies":{"@actions/core":"^1.9.1","@actions/github":"^5.1.1","actions-toolkit":"github:nearform/actions-toolkit","gitdiff-parser":"^0.3.1","semver":"^7.5.4"},"devDependencies":{"@vercel/ncc":"^0.36.1","eslint":"^8.46.0","eslint-config-prettier":"^8.9.0","eslint-plugin-prettier":"^4.2.1","husky":"^8.0.3","prettier":"^2.8.8","proxyquire":"^2.1.3","sinon":"^15.2.0","tap":"^16.3.8"}}');

/***/ })

Expand Down
2 changes: 1 addition & 1 deletion src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = async function run({

if (
TARGET !== updateTypes.any &&
updateTypesPriority.indexOf(updateType) >
updateTypesPriority.indexOf(updateType) <
updateTypesPriority.indexOf(TARGET)
) {
core.setOutput(MERGE_STATUS_KEY, MERGE_STATUS.skippedBumpHigherThanTarget)
Expand Down
6 changes: 3 additions & 3 deletions src/mapUpdateType.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const updateTypes = {
}

const updateTypesPriority = [
updateTypes.patch,
updateTypes.minor,
updateTypes.major,
updateTypes.any,
updateTypes.major,
updateTypes.minor,
updateTypes.patch,
]

const mapUpdateType = input => {
Expand Down

0 comments on commit f663cb1

Please sign in to comment.