Skip to content

Commit

Permalink
fix: lock temporarily unlocked issues even after an error
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Jul 4, 2021
1 parent 731cce0 commit 182adbd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,14 @@ class App {
lock.reason = issueData.active_lock_reason;
}
await this.client.issues.unlock(issue);
await action();

let actionError;
try {
await action();
} catch (err) {
actionError = err;
}

if (lock.reason) {
issue = {
...issue,
Expand All @@ -137,6 +144,10 @@ class App {
};
}
await this.client.issues.lock(issue);

if (actionError) {
throw actionError;
}
} else {
await action();
}
Expand Down

0 comments on commit 182adbd

Please sign in to comment.