@@ -9690,7 +9690,12 @@ const toolkit = __nccwpck_require__(2183)
9690
9690
const packageInfo = __nccwpck_require__(4147)
9691
9691
const { githubClient } = __nccwpck_require__(3386)
9692
9692
const { logInfo, logWarning, logError } = __nccwpck_require__(653)
9693
- const { isValidSemver, isCommitHash, getInputs, getPackageName } = __nccwpck_require__(6254)
9693
+ const {
9694
+ isValidSemver,
9695
+ isCommitHash,
9696
+ getInputs,
9697
+ getPackageName,
9698
+ } = __nccwpck_require__(6254)
9694
9699
const { targetOptions } = __nccwpck_require__(5013)
9695
9700
const {
9696
9701
getModuleVersionChanges,
@@ -9742,7 +9747,9 @@ module.exports = async function run() {
9742
9747
}
9743
9748
}
9744
9749
9745
- const changedExcludedPackages = EXCLUDE_PKGS.filter((pkg) => pkg in moduleChanges)
9750
+ const changedExcludedPackages = EXCLUDE_PKGS.filter(
9751
+ pkg => pkg in moduleChanges
9752
+ )
9746
9753
if (changedExcludedPackages.length > 0) {
9747
9754
return logInfo(`${changedExcludedPackages.length} package(s) excluded: \
9748
9755
${changedExcludedPackages.join(', ')}. Skipping.`)
@@ -9775,7 +9782,7 @@ function isAMajorReleaseBump(change) {
9775
9782
const from = change.delete
9776
9783
const to = change.insert
9777
9784
9778
- if (isCommitHash(from) && isCommitHash(to)) {
9785
+ if (isCommitHash(from) && isCommitHash(to)) {
9779
9786
return false
9780
9787
}
9781
9788
@@ -9788,7 +9795,9 @@ function parsePrTitle(pullRequest) {
9788
9795
const match = expression.exec(pullRequest.title)
9789
9796
9790
9797
if (!match) {
9791
- throw new Error('Error while parsing PR title, expected: `bump <package> from <old-version> to <new-version>`')
9798
+ throw new Error(
9799
+ 'Error while parsing PR title, expected: `bump <package> from <old-version> to <new-version>`'
9800
+ )
9792
9801
}
9793
9802
9794
9803
const packageName = getPackageName(pullRequest.head.ref)
@@ -9799,8 +9808,8 @@ function parsePrTitle(pullRequest) {
9799
9808
return {
9800
9809
[packageName]: {
9801
9810
delete: isValid ? semverCoerce(oldVersion)?.raw : oldVersion,
9802
- insert: isValid ? semverCoerce(newVersion)?.raw : newVersion
9803
- }
9811
+ insert: isValid ? semverCoerce(newVersion)?.raw : newVersion,
9812
+ },
9804
9813
}
9805
9814
}
9806
9815
@@ -9821,7 +9830,7 @@ const targetOptions = {
9821
9830
patch: 'patch',
9822
9831
prepatch: 'prepatch',
9823
9832
prerelease: 'prerelease',
9824
- any: 'any'
9833
+ any: 'any',
9825
9834
}
9826
9835
9827
9836
const semanticVersionOrder = [
@@ -9832,7 +9841,7 @@ const semanticVersionOrder = [
9832
9841
targetOptions.minor,
9833
9842
targetOptions.premajor,
9834
9843
targetOptions.major,
9835
- targetOptions.any
9844
+ targetOptions.any,
9836
9845
]
9837
9846
9838
9847
const getTargetInput = input => {
@@ -9876,7 +9885,7 @@ function githubClient(githubToken) {
9876
9885
repo: repoName,
9877
9886
pull_number: pullRequestNumber,
9878
9887
event: 'APPROVE',
9879
- body: approveComment
9888
+ body: approveComment,
9880
9889
})
9881
9890
// todo assert
9882
9891
return data
@@ -9920,10 +9929,10 @@ module.exports = { githubClient }
9920
9929
9921
9930
const { debug, error, info, warning } = __nccwpck_require__(2186)
9922
9931
9923
- const stringify = ( msg) =>
9932
+ const stringify = msg =>
9924
9933
typeof msg === 'string' ? msg : msg.stack || msg.toString()
9925
9934
9926
- const log = ( logger) => ( message) => logger(stringify(message))
9935
+ const log = logger => message => logger(stringify(message))
9927
9936
9928
9937
exports.logDebug = log(debug)
9929
9938
exports.logError = log(error)
@@ -9962,7 +9971,9 @@ const checkModuleVersionChanges = (moduleChanges, target) => {
9962
9971
}
9963
9972
9964
9973
if (!isValidSemver(from) || !isValidSemver(to)) {
9965
- throw new Error(`Module "${module}" contains invalid semver versions from: ${from} to: ${to}`)
9974
+ throw new Error(
9975
+ `Module "${module}" contains invalid semver versions from: ${from} to: ${to}`
9976
+ )
9966
9977
}
9967
9978
9968
9979
const diff = semverDiff(semverCoerce(from), semverCoerce(to))
@@ -9977,17 +9988,19 @@ const checkModuleVersionChanges = (moduleChanges, target) => {
9977
9988
return true
9978
9989
}
9979
9990
9980
- const getModuleVersionChanges = ( prDiff) => {
9991
+ const getModuleVersionChanges = prDiff => {
9981
9992
const parsedDiffFiles = parse(prDiff)
9982
- const packageJsonChanges = parsedDiffFiles.find((file) => file.newPath === 'package.json')
9993
+ const packageJsonChanges = parsedDiffFiles.find(
9994
+ file => file.newPath === 'package.json'
9995
+ )
9983
9996
if (!packageJsonChanges) {
9984
9997
return false
9985
9998
}
9986
9999
9987
10000
const moduleChanges = {}
9988
10001
for (const idx in packageJsonChanges.hunks) {
9989
10002
const changes = packageJsonChanges.hunks[idx].changes.filter(
9990
- (c) => c.type === 'delete' || c.type === 'insert'
10003
+ c => c.type === 'delete' || c.type === 'insert'
9991
10004
)
9992
10005
9993
10006
for (const changeIdx in changes) {
@@ -10050,8 +10063,8 @@ const getMergeMethod = () => {
10050
10063
return mergeMethods[input]
10051
10064
}
10052
10065
10053
- const parseCommaSeparatedValue = ( value) => {
10054
- return value ? value.split(',').map(el => el.trim()) : [];
10066
+ const parseCommaSeparatedValue = value => {
10067
+ return value ? value.split(',').map(el => el.trim()) : []
10055
10068
}
10056
10069
10057
10070
exports.getInputs = () => ({
@@ -10071,7 +10084,7 @@ exports.getInputs = () => ({
10071
10084
* @param {String} branchName
10072
10085
* @returns Package name extracted from branch
10073
10086
*/
10074
- exports.getPackageName = ( branchName) => {
10087
+ exports.getPackageName = branchName => {
10075
10088
const nameWithVersion = branchName.split('/').pop().split('-')
10076
10089
const version = nameWithVersion.pop()
10077
10090
const packageName = nameWithVersion.join('-')
@@ -10090,7 +10103,7 @@ exports.getPackageName = (branchName) => {
10090
10103
* @param {String} version
10091
10104
* @returns Boolean indicating whether version
10092
10105
*/
10093
- exports.isCommitHash = function(version) {
10106
+ exports.isCommitHash = function (version) {
10094
10107
return /^[a-f0-9]{5,40}$/.test(version)
10095
10108
}
10096
10109
@@ -10246,7 +10259,7 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
10246
10259
/***/ ((module) => {
10247
10260
10248
10261
"use strict";
10249
- module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.1.7","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.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","husky":"^8.0.1","prettier":"^2.6.2","proxyquire":"^2.1.3","sinon":"^14.0.0","tap":"^16.2.0"}}');
10262
+ module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.1.7","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.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"}}');
10250
10263
10251
10264
/***/ })
10252
10265
0 commit comments