Skip to content

Commit 67b7d5d

Browse files
committed
Merge branch 'main' into release
2 parents 2693de4 + 06929e8 commit 67b7d5d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

labelMutex.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,13 @@ func (lm *LabelMutex) processPR() error {
181181
success, existingValue, lockErr := lm.uriLocker.Lock(lockValue)
182182
if success {
183183
lm.locked = true
184+
lm.htmlURL = lockValue
184185
log.Printf("Weird, the lock should have already been ours!")
185186
return nil
186187
}
187188
if existingValue == lockValue {
188189
lm.locked = true
190+
lm.htmlURL = lockValue
189191
return nil
190192
}
191193
return lockErr

labelMutex_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@ func init() {
160160
unlockedOutput: "false",
161161
htmlURLOutput: "https://github.com/urcomputeringpal/label-mutex/pull/1",
162162
},
163+
// sync the pr
164+
{
165+
eventFilename: "testdata/1/pull_request.synchronize_with_labels.json",
166+
eventName: "pull_request",
167+
label: "staging",
168+
issuesClient: &happyPathLabelClient{},
169+
uriLocker: URILockerOne,
170+
err: false,
171+
locked: true,
172+
lockedOutput: "true",
173+
unlockedOutput: "false",
174+
htmlURLOutput: "https://github.com/urcomputeringpal/label-mutex/pull/1",
175+
},
163176
// try to read it
164177
{
165178
eventFilename: "testdata/push.json",

0 commit comments

Comments
 (0)