mirror of
https://github.com/actions/stale.git
synced 2025-12-28 11:08:18 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bb2a723cb | ||
|
|
48bae5932f | ||
|
|
2b58cc900f |
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set Node.js 16.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
|
|
||||||
|
|||||||
2061
dist/index.js
vendored
2061
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -418,7 +418,7 @@ export class IssuesProcessor {
|
|||||||
|
|
||||||
// Determine if this issue needs to be marked stale first
|
// Determine if this issue needs to be marked stale first
|
||||||
if (!issue.isStale) {
|
if (!issue.isStale) {
|
||||||
issueLogger.info(`This $$type is not stale`);
|
issueLogger.info(`This $$type is not stale. Demo message.`);
|
||||||
const shouldIgnoreUpdates: boolean = new IgnoreUpdates(
|
const shouldIgnoreUpdates: boolean = new IgnoreUpdates(
|
||||||
this.options,
|
this.options,
|
||||||
issue
|
issue
|
||||||
@@ -625,13 +625,15 @@ export class IssuesProcessor {
|
|||||||
`$$type marked stale on: ${LoggerService.cyan(markedStaleOn)}`
|
`$$type marked stale on: ${LoggerService.cyan(markedStaleOn)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const issueHasComments: boolean = await this._hasCommentsSince(
|
const issueHasCommentsSinceStale: boolean = await this._hasCommentsSince(
|
||||||
issue,
|
issue,
|
||||||
markedStaleOn,
|
markedStaleOn,
|
||||||
staleMessage
|
staleMessage
|
||||||
);
|
);
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
`$$type has been commented on: ${LoggerService.cyan(issueHasComments)}`
|
`$$type has been commented on: ${LoggerService.cyan(
|
||||||
|
issueHasCommentsSinceStale
|
||||||
|
)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const daysBeforeClose: number = issue.isPullRequest
|
const daysBeforeClose: number = issue.isPullRequest
|
||||||
@@ -642,14 +644,6 @@ export class IssuesProcessor {
|
|||||||
`Days before $$type close: ${LoggerService.cyan(daysBeforeClose)}`
|
`Days before $$type close: ${LoggerService.cyan(daysBeforeClose)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const issueHasUpdate: boolean = IssuesProcessor._updatedSince(
|
|
||||||
issue.updated_at,
|
|
||||||
daysBeforeClose
|
|
||||||
);
|
|
||||||
issueLogger.info(
|
|
||||||
`$$type has been updated: ${LoggerService.cyan(issueHasUpdate)}`
|
|
||||||
);
|
|
||||||
|
|
||||||
const shouldRemoveStaleWhenUpdated: boolean =
|
const shouldRemoveStaleWhenUpdated: boolean =
|
||||||
this._shouldRemoveStaleWhenUpdated(issue);
|
this._shouldRemoveStaleWhenUpdated(issue);
|
||||||
|
|
||||||
@@ -671,10 +665,19 @@ export class IssuesProcessor {
|
|||||||
issueLogger.info(`marked stale this run, so don't check for updates`);
|
issueLogger.info(`marked stale this run, so don't check for updates`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const issueHasUpdateSinceStale =
|
||||||
|
new Date(issue.updated_at) > new Date(markedStaleOn);
|
||||||
|
|
||||||
|
issueLogger.info(
|
||||||
|
`$$type has been updated since it was marked stale: ${LoggerService.cyan(
|
||||||
|
issueHasUpdateSinceStale
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
|
||||||
// Should we un-stale this issue?
|
// Should we un-stale this issue?
|
||||||
if (
|
if (
|
||||||
shouldRemoveStaleWhenUpdated &&
|
shouldRemoveStaleWhenUpdated &&
|
||||||
(issueHasUpdate || issueHasComments) &&
|
(issueHasUpdateSinceStale || issueHasCommentsSinceStale) &&
|
||||||
!issue.markedStaleThisRun
|
!issue.markedStaleThisRun
|
||||||
) {
|
) {
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
@@ -696,7 +699,17 @@ export class IssuesProcessor {
|
|||||||
return; // Nothing to do because we aren't closing stale issues
|
return; // Nothing to do because we aren't closing stale issues
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!issueHasComments && !issueHasUpdate) {
|
const issueHasUpdateInCloseWindow: boolean = IssuesProcessor._updatedSince(
|
||||||
|
issue.updated_at,
|
||||||
|
daysBeforeClose
|
||||||
|
);
|
||||||
|
issueLogger.info(
|
||||||
|
`$$type has been updated in the last ${daysBeforeClose} days: ${LoggerService.cyan(
|
||||||
|
issueHasUpdateInCloseWindow
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!issueHasCommentsSinceStale && !issueHasUpdateInCloseWindow) {
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
`Closing $$type because it was last updated on: ${LoggerService.cyan(
|
`Closing $$type because it was last updated on: ${LoggerService.cyan(
|
||||||
issue.updated_at
|
issue.updated_at
|
||||||
@@ -715,7 +728,7 @@ export class IssuesProcessor {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
issueLogger.info(
|
issueLogger.info(
|
||||||
`Stale $$type is not old enough to close yet (hasComments? ${issueHasComments}, hasUpdate? ${issueHasUpdate})`
|
`Stale $$type is not old enough to close yet (hasComments? ${issueHasCommentsSinceStale}, hasUpdate? ${issueHasUpdateInCloseWindow})`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user