Skip to content

Commit 8fb578d

Browse files
authoredAug 9, 2021
fix: subdirectory pull requests from dependabot (#61)
* fix: subdirectory pull requests from dependabot * fix: chmod +x .husky/pre-commit
1 parent c491a0d commit 8fb578d

File tree

4 files changed

+3082
-19
lines changed

4 files changed

+3082
-19
lines changed
 

‎.husky/pre-commit

100644100755
File mode changed.

‎dist/index.js

+3,077-18
Large diffs are not rendered by default.

‎src/checkTargetMatchToPR.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const semverDiff = require('semver/functions/diff')
33

44
const { semanticVersionOrder } = require('./getTargetInput')
55

6-
const expression = /from ([^\s]+) to (.+)$/
6+
const expression = /from ([^\s]+) to ([^\s]+)/
77

88
const checkTargetMatchToPR = (prTitle, target) => {
99
const match = expression.exec(prTitle)

‎test/checkTargetMatchToPR.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ const preReleaseUpgradePRTitle =
1717
const preReleaseToPathUpgradePRTitle =
1818
'chore(deps-dev): bump fastify from 3.18.0-alpha to 3.18.2'
1919
const sameVersion = 'chore(deps-dev): bump fastify from 3.18.0 to 3.18.0'
20+
const patchPRTitleInSubDirectory = 'chore(deps-dev): bump fastify from 3.18.0 to 3.18.1 in /packages/a'
2021

2122
tap.test('checkTargetMatchToPR', async t => {
2223
t.test('should return true when target is major', async t => {
2324
t.test('and PR is patch', async t => {
2425
t.ok(checkTargetMatchToPR(patchPRTitle, targetOptions.major))
2526
})
27+
t.test('and PR is patch in a subdirectory', async t => {
28+
t.ok(checkTargetMatchToPR(patchPRTitleInSubDirectory, targetOptions.major))
29+
})
2630
t.test('and PR is patch with pre-release version', async t => {
2731
t.ok(checkTargetMatchToPR(preReleaseUpgradePRTitle, targetOptions.major))
2832
})

0 commit comments

Comments
 (0)
Please sign in to comment.