mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 18:25:58 +08:00
10
src/base.js
10
src/base.js
@@ -132,11 +132,17 @@ async function doDeleteComment(owner, repo, commentId) {
|
||||
}
|
||||
|
||||
async function doLockIssue(owner, repo, issueNumber) {
|
||||
await octokit.issues.lock({
|
||||
const lockReason = core.getInput('lock-reason');
|
||||
let params = {
|
||||
owner,
|
||||
repo,
|
||||
issue_number: issueNumber,
|
||||
});
|
||||
};
|
||||
const reasons = ['off-topic', 'too heated', 'resolved', 'spam'];
|
||||
if (lockReason && reasons.includes(lockReason)) {
|
||||
params.lock_reason = lockReason;
|
||||
}
|
||||
await octokit.issues.lock(params);
|
||||
core.info(`Actions: [lock-issue][${issueNumber}] success!`);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user