mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-22 19:49:13 +08:00
@@ -365,6 +365,9 @@ jobs:
|
|||||||
| actions | Action type | string | ✔ |
|
| actions | Action type | string | ✔ |
|
||||||
| token | [Token explain](#token) | string | ✔ |
|
| token | [Token explain](#token) | string | ✔ |
|
||||||
| issue-number | The number of issue | number | ✔ |
|
| issue-number | The number of issue | number | ✔ |
|
||||||
|
| lock-reason | Reason for locking issue | string | ✖ |
|
||||||
|
|
||||||
|
- `lock-reason`: Optional values are `off-topic` `too heated` `resolved` `spam`
|
||||||
|
|
||||||
⏫ [Back to list](#List)
|
⏫ [Back to list](#List)
|
||||||
|
|
||||||
@@ -861,6 +864,7 @@ jobs:
|
|||||||
| body-includes | Body filtering | string | ✖ |
|
| body-includes | Body filtering | string | ✖ |
|
||||||
| title-includes | Title filtering | string | ✖ |
|
| title-includes | Title filtering | string | ✖ |
|
||||||
| inactive-day | Inactive days filtering | number | ✖ |
|
| inactive-day | Inactive days filtering | number | ✖ |
|
||||||
|
| lock-reason | Reason for locking issue | string | ✖ |
|
||||||
|
|
||||||
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all
|
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all
|
||||||
- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all`
|
- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all`
|
||||||
|
@@ -365,6 +365,9 @@ jobs:
|
|||||||
| actions | 操作类型 | string | ✔ |
|
| actions | 操作类型 | string | ✔ |
|
||||||
| token | [token 说明](#token) | string | ✔ |
|
| token | [token 说明](#token) | string | ✔ |
|
||||||
| issue-number | 指定的 issue | number | ✔ |
|
| issue-number | 指定的 issue | number | ✔ |
|
||||||
|
| lock-reason | 锁定 issue 的原因 | string | ✖ |
|
||||||
|
|
||||||
|
- `lock-reason`:可选值有 `off-topic` `too heated` `resolved` `spam`
|
||||||
|
|
||||||
⏫ [返回列表](#列-表)
|
⏫ [返回列表](#列-表)
|
||||||
|
|
||||||
@@ -855,6 +858,7 @@ jobs:
|
|||||||
| body-includes | 包含内容筛选 | string | ✖ |
|
| body-includes | 包含内容筛选 | string | ✖ |
|
||||||
| title-includes | 包含标题筛选 | string | ✖ |
|
| title-includes | 包含标题筛选 | string | ✖ |
|
||||||
| inactive-day | 非活跃天数筛选 | number | ✖ |
|
| inactive-day | 非活跃天数筛选 | number | ✖ |
|
||||||
|
| lock-reason | 锁定 issue 的原因 | string | ✖ |
|
||||||
|
|
||||||
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
|
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
|
||||||
- `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open`
|
- `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open`
|
||||||
|
@@ -52,6 +52,8 @@ inputs:
|
|||||||
description: 'Query use'
|
description: 'Query use'
|
||||||
inactive-day:
|
inactive-day:
|
||||||
description: 'Query use'
|
description: 'Query use'
|
||||||
|
lock-reason:
|
||||||
|
description: 'The reason lock issue'
|
||||||
inactive-label:
|
inactive-label:
|
||||||
description: 'Issue label set use'
|
description: 'Issue label set use'
|
||||||
duplicate-command:
|
duplicate-command:
|
||||||
|
10
dist/index.js
vendored
10
dist/index.js
vendored
@@ -7995,11 +7995,17 @@ async function doDeleteComment(owner, repo, commentId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function doLockIssue(owner, repo, issueNumber) {
|
async function doLockIssue(owner, repo, issueNumber) {
|
||||||
await octokit.issues.lock({
|
const lockReason = core.getInput('lock-reason');
|
||||||
|
let params = {
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
issue_number: issueNumber,
|
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!`);
|
core.info(`Actions: [lock-issue][${issueNumber}] success!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -210,6 +210,7 @@ jobs:
|
|||||||
| body-includes | Body filtering | string | ✖ |
|
| body-includes | Body filtering | string | ✖ |
|
||||||
| title-includes | Title filtering | string | ✖ |
|
| title-includes | Title filtering | string | ✖ |
|
||||||
| inactive-day | Inactive days filtering | number | ✖ |
|
| inactive-day | Inactive days filtering | number | ✖ |
|
||||||
|
| lock-reason | Reason for locking issue | string | ✖ |
|
||||||
|
|
||||||
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all
|
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all
|
||||||
- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all`
|
- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all`
|
||||||
|
@@ -206,6 +206,7 @@ jobs:
|
|||||||
| body-includes | 包含内容筛选 | string | ✖ |
|
| body-includes | 包含内容筛选 | string | ✖ |
|
||||||
| title-includes | 包含标题筛选 | string | ✖ |
|
| title-includes | 包含标题筛选 | string | ✖ |
|
||||||
| inactive-day | 非活跃天数筛选 | number | ✖ |
|
| inactive-day | 非活跃天数筛选 | number | ✖ |
|
||||||
|
| lock-reason | 锁定 issue 的原因 | string | ✖ |
|
||||||
|
|
||||||
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
|
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
|
||||||
- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all`
|
- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all`
|
||||||
|
@@ -231,6 +231,9 @@ jobs:
|
|||||||
| actions | Action type | string | ✔ |
|
| actions | Action type | string | ✔ |
|
||||||
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
|
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
|
||||||
| issue-number | The number of issue | number | ✔ |
|
| issue-number | The number of issue | number | ✔ |
|
||||||
|
| lock-reason | Reason for locking issue | string | ✖ |
|
||||||
|
|
||||||
|
- `lock-reason`: Optional values are `off-topic` `too heated` `resolved` `spam`
|
||||||
|
|
||||||
## `mark-duplicate`
|
## `mark-duplicate`
|
||||||
|
|
||||||
|
@@ -231,6 +231,9 @@ jobs:
|
|||||||
| actions | 操作类型 | string | ✔ |
|
| actions | 操作类型 | string | ✔ |
|
||||||
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
|
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
|
||||||
| issue-number | 指定的 issue | number | ✔ |
|
| issue-number | 指定的 issue | number | ✔ |
|
||||||
|
| lock-reason | 锁定 issue 的原因 | string | ✖ |
|
||||||
|
|
||||||
|
- `lock-reason`:可选值有 `off-topic` `too heated` `resolved` `spam`
|
||||||
|
|
||||||
## `mark-duplicate`
|
## `mark-duplicate`
|
||||||
|
|
||||||
|
10
src/base.js
10
src/base.js
@@ -132,11 +132,17 @@ async function doDeleteComment(owner, repo, commentId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function doLockIssue(owner, repo, issueNumber) {
|
async function doLockIssue(owner, repo, issueNumber) {
|
||||||
await octokit.issues.lock({
|
const lockReason = core.getInput('lock-reason');
|
||||||
|
let params = {
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
issue_number: issueNumber,
|
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!`);
|
core.info(`Actions: [lock-issue][${issueNumber}] success!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user