mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 10:15:59 +08:00
feat: support comment update 4 check-inactive (#158)
* feat: support comment update 4 check-inactive * docs:fix
This commit is contained in:
@@ -792,6 +792,7 @@ jobs:
|
||||
| body-includes | Body filtering | string | ✖ |
|
||||
| title-includes | Title filtering | string | ✖ |
|
||||
| inactive-day | Inactive days filtering | number | ✖ |
|
||||
| inactive-mode | Detect inactive mode, default `issue`, optional `comment`, which is the last comment update time | string | ✖ |
|
||||
| inactive-label | The label name adding | string | ✖ |
|
||||
| exclude-labels | Exclude labels filtering | string | ✖ |
|
||||
|
||||
|
@@ -796,6 +796,7 @@ jobs:
|
||||
| body-includes | 包含内容筛选 | string | ✖ |
|
||||
| title-includes | 包含标题筛选 | string | ✖ |
|
||||
| inactive-day | 非活跃天数筛选 | number | ✖ |
|
||||
| inactive-mode | 检测不活跃的模式,默认 `issue`,可选 `comment`,即为最后一个评论更新时间 | string | ✖ |
|
||||
| inactive-label | 新增标签名称 | string | ✖ |
|
||||
| exclude-labels | 排除标签筛选 | string | ✖ |
|
||||
|
||||
|
@@ -75,6 +75,8 @@ inputs:
|
||||
description: 'Query use'
|
||||
inactive-day:
|
||||
description: 'Query use'
|
||||
inactive-mode:
|
||||
description: 'Inactive mode'
|
||||
lock-reason:
|
||||
description: 'The reason lock issue'
|
||||
inactive-label:
|
||||
|
@@ -21,6 +21,7 @@
|
||||
"lint": "eslint src/*.ts src/*/*.ts",
|
||||
"lint-fix": "eslint src/*.ts src/*/*.ts --fix",
|
||||
"lint-up": "npm run format && npm run lint-fix",
|
||||
"ci:fix": "npm run lint-up",
|
||||
"lint-all": "npm run format-check && npm run lint",
|
||||
"check-commit": "node ./scripts/check-commit.js",
|
||||
"tag": "node ./scripts/tag.js",
|
||||
|
@@ -59,7 +59,7 @@ export async function doQueryIssues(
|
||||
const titleIncludes = core.getInput('title-includes');
|
||||
|
||||
const excludeLabelsArr = dealStringToArr(excludeLabels);
|
||||
issuesList.forEach(issue => {
|
||||
issuesList.forEach(async issue => {
|
||||
const bodyCheck = bodyIncludes ? issue.body.includes(bodyIncludes) : true;
|
||||
const titleCheck = titleIncludes ? issue.title.includes(titleIncludes) : true;
|
||||
/**
|
||||
@@ -84,8 +84,17 @@ export async function doQueryIssues(
|
||||
dayjs.extend(isSameOrBefore);
|
||||
|
||||
const lastTime = dayjs.utc().subtract(+inactiveDay, 'day');
|
||||
const updateTime = dayjs.utc(issue.updated_at);
|
||||
if (updateTime.isSameOrBefore(lastTime)) {
|
||||
|
||||
const inactiveMode = core.getInput('inactive-mode') || 'issue';
|
||||
let updateTime = dayjs.utc(issue.updated_at);
|
||||
if (inactiveMode === 'comment') {
|
||||
ICE.setIssueNumber(issue.number);
|
||||
const comments = await ICE.listComments();
|
||||
if (comments.length) {
|
||||
updateTime = dayjs.utc(comments[comments.length - 1].updated_at);
|
||||
}
|
||||
}
|
||||
if (updateTime && updateTime.isSameOrBefore(lastTime)) {
|
||||
issues.push(issue);
|
||||
issueNumbers.push(issue.number);
|
||||
}
|
||||
|
Reference in New Issue
Block a user