Skip to content

Commit 9b3f5fa

Browse files
authored
Merge pull request #456 from stephenfin/unhold-with-description
Allow reason with /unhold too
2 parents 8173b70 + 3d77d2c commit 9b3f5fa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/plugins/hold/hold.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const (
4040

4141
var (
4242
labelRe = regexp.MustCompile(`(?mi)^/hold(\s.*)?$`)
43-
labelCancelRe = regexp.MustCompile(`(?mi)^/(remove-hold|hold\s+cancel|unhold)\s*$`)
43+
labelCancelRe = regexp.MustCompile(`(?mi)^/(remove-hold|hold\s+cancel|unhold)(\s.*)?$`)
4444
)
4545

4646
type hasLabelFunc func(label string, issueLabels []github.Label) bool

pkg/plugins/hold/hold_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ func TestHandle(t *testing.T) {
9393
isPR: true,
9494
},
9595
{
96-
name: "requested hold cancel with whitespace",
97-
body: "/hold cancel ",
96+
name: "requested hold cancel with a reason",
97+
body: "/hold cancel further review has happened and I have whitespace",
9898
hasLabel: true,
9999
shouldLabel: false,
100100
shouldUnlabel: true,
@@ -117,8 +117,8 @@ func TestHandle(t *testing.T) {
117117
isPR: true,
118118
},
119119
{
120-
name: "requested unhold with whitespace",
121-
body: "/unhold ",
120+
name: "requested unhold with a reason",
121+
body: "/unhold further review has happened and I have whitespace",
122122
hasLabel: true,
123123
shouldLabel: false,
124124
shouldUnlabel: true,

0 commit comments

Comments
 (0)