mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[ci] only close inactive issues with no labels
This commit is contained in:
8
.github/workflows/close-issue.yml
vendored
8
.github/workflows/close-issue.yml
vendored
@@ -26,13 +26,17 @@ jobs:
|
||||
const lastUpdated = new Date(issue.updated_at).getTime();
|
||||
|
||||
// if the issue hasn't been updated in the past week, close it
|
||||
if (now - lastUpdated > inactivePeriod) {
|
||||
console.log(`Closing inactive issue: ${issue.number}`);
|
||||
if (now - lastUpdated > inactivePeriod && issue.labels.length === 0) {
|
||||
console.log(`Closing inactive issue: ${issue.number} (No labels)`);
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
state: 'closed',
|
||||
});
|
||||
} else if (issue.labels.length === 0) {
|
||||
console.log(`Skipping issue ${issue.number} (No labels) as it has been recently updated.`);
|
||||
} else {
|
||||
console.log(`Skipping issue ${issue.number} (Has labels).`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user