Skip to content

Commit 9e255af

Browse files
Uzlopaksimoneb
andauthored
change parseCommaSeparatedValue to parseCommaOrSemicolonSeparatedValue (#250)
* change parseCommaSeparatedValue to parseCommaOrSemicolonSeparatedValue * update Readme * Update README.md Co-authored-by: Simone Busoli <simone.busoli@nearform.com> Co-authored-by: Simone Busoli <simone.busoli@nearform.com>
1 parent ddd38a6 commit 9e255af

File tree

3 files changed

+80
-8
lines changed

3 files changed

+80
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This action automatically approves and merges dependabot PRs.
1111

1212
### `exclude`
1313

14-
_Optional_ A comma separated value of packages that you don't want to auto-merge and would like to manually review to decide whether to upgrade or not.
14+
_Optional_ A comma or semicolon separated value of packages that you don't want to auto-merge and would like to manually review to decide whether to upgrade or not.
1515

1616
### `approve-only`
1717

dist/index.js

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,13 @@ Object.defineProperty(exports, "summary", ({ enumerable: true, get: function ()
425425
*/
426426
var summary_2 = __nccwpck_require__(1327);
427427
Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
428+
/**
429+
* Path exports
430+
*/
431+
var path_utils_1 = __nccwpck_require__(2981);
432+
Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
433+
Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
434+
Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
428435
//# sourceMappingURL=core.js.map
429436

430437
/***/ }),
@@ -562,6 +569,71 @@ exports.OidcClient = OidcClient;
562569

563570
/***/ }),
564571

572+
/***/ 2981:
573+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
574+
575+
"use strict";
576+
577+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
578+
if (k2 === undefined) k2 = k;
579+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
580+
}) : (function(o, m, k, k2) {
581+
if (k2 === undefined) k2 = k;
582+
o[k2] = m[k];
583+
}));
584+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
585+
Object.defineProperty(o, "default", { enumerable: true, value: v });
586+
}) : function(o, v) {
587+
o["default"] = v;
588+
});
589+
var __importStar = (this && this.__importStar) || function (mod) {
590+
if (mod && mod.__esModule) return mod;
591+
var result = {};
592+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
593+
__setModuleDefault(result, mod);
594+
return result;
595+
};
596+
Object.defineProperty(exports, "__esModule", ({ value: true }));
597+
exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
598+
const path = __importStar(__nccwpck_require__(1017));
599+
/**
600+
* toPosixPath converts the given path to the posix form. On Windows, \\ will be
601+
* replaced with /.
602+
*
603+
* @param pth. Path to transform.
604+
* @return string Posix path.
605+
*/
606+
function toPosixPath(pth) {
607+
return pth.replace(/[\\]/g, '/');
608+
}
609+
exports.toPosixPath = toPosixPath;
610+
/**
611+
* toWin32Path converts the given path to the win32 form. On Linux, / will be
612+
* replaced with \\.
613+
*
614+
* @param pth. Path to transform.
615+
* @return string Win32 path.
616+
*/
617+
function toWin32Path(pth) {
618+
return pth.replace(/[/]/g, '\\');
619+
}
620+
exports.toWin32Path = toWin32Path;
621+
/**
622+
* toPlatformPath converts the given path to a platform-specific path. It does
623+
* this by replacing instances of / and \ with the platform-specific path
624+
* separator.
625+
*
626+
* @param pth The path to platformize.
627+
* @return string The platform-specific path.
628+
*/
629+
function toPlatformPath(pth) {
630+
return pth.replace(/[/\\]/g, path.sep);
631+
}
632+
exports.toPlatformPath = toPlatformPath;
633+
//# sourceMappingURL=path-utils.js.map
634+
635+
/***/ }),
636+
565637
/***/ 1327:
566638
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
567639

@@ -10106,14 +10178,14 @@ const getMergeMethod = () => {
1010610178
return mergeMethods[input]
1010710179
}
1010810180

10109-
const parseCommaSeparatedValue = value => {
10110-
return value ? value.split(',').map(el => el.trim()) : []
10181+
const parseCommaOrSemicolonSeparatedValue = value => {
10182+
return value ? value.split(/[;,]/).map(el => el.trim()) : []
1011110183
}
1011210184

1011310185
exports.getInputs = () => ({
1011410186
GITHUB_TOKEN: core.getInput('github-token', { required: true }),
1011510187
MERGE_METHOD: getMergeMethod(),
10116-
EXCLUDE_PKGS: parseCommaSeparatedValue(core.getInput('exclude')),
10188+
EXCLUDE_PKGS: parseCommaOrSemicolonSeparatedValue(core.getInput('exclude')),
1011710189
MERGE_COMMENT: core.getInput('merge-comment') || '',
1011810190
APPROVE_ONLY: /true/i.test(core.getInput('approve-only')),
1011910191
TARGET: getTargetInput(core.getInput('target')),
@@ -10352,7 +10424,7 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
1035210424
/***/ ((module) => {
1035310425

1035410426
"use strict";
10355-
module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.2.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":"SalmanMitha@gmail.com"},"contributors":["Simone Busoli <simone.busoli@nearform.com>"],"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.8.2","@actions/github":"^5.0.3","actions-toolkit":"github:nearform/actions-toolkit","gitdiff-parser":"^0.2.2","semver":"^7.3.7"},"devDependencies":{"@vercel/ncc":"^0.33.4","eslint":"^8.16.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","husky":"^8.0.1","prettier":"^2.6.2","proxyquire":"^2.1.3","sinon":"^14.0.0","tap":"^16.2.0"}}');
10427+
module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.2.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":"SalmanMitha@gmail.com"},"contributors":["Simone Busoli <simone.busoli@nearform.com>"],"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.0","@actions/github":"^5.0.3","actions-toolkit":"github:nearform/actions-toolkit","gitdiff-parser":"^0.2.2","semver":"^7.3.7"},"devDependencies":{"@vercel/ncc":"^0.34.0","eslint":"^8.21.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","husky":"^8.0.1","prettier":"^2.7.1","proxyquire":"^2.1.3","sinon":"^14.0.0","tap":"^16.3.0"}}');
1035610428

1035710429
/***/ })
1035810430

src/util.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ const getMergeMethod = () => {
2626
return mergeMethods[input]
2727
}
2828

29-
const parseCommaSeparatedValue = value => {
30-
return value ? value.split(',').map(el => el.trim()) : []
29+
const parseCommaOrSemicolonSeparatedValue = value => {
30+
return value ? value.split(/[;,]/).map(el => el.trim()) : []
3131
}
3232

3333
exports.getInputs = () => ({
3434
GITHUB_TOKEN: core.getInput('github-token', { required: true }),
3535
MERGE_METHOD: getMergeMethod(),
36-
EXCLUDE_PKGS: parseCommaSeparatedValue(core.getInput('exclude')),
36+
EXCLUDE_PKGS: parseCommaOrSemicolonSeparatedValue(core.getInput('exclude')),
3737
MERGE_COMMENT: core.getInput('merge-comment') || '',
3838
APPROVE_ONLY: /true/i.test(core.getInput('approve-only')),
3939
TARGET: getTargetInput(core.getInput('target')),

0 commit comments

Comments
 (0)