Allow for issues/PRs to be closed after manually being marked as stale (#103)

Previously this action would stop and skip all issues or pull requests
it found if no `stale-issue-message | stale-pr-message` option had
been configured.

Configuring `days-before-stale: -1` will activate that behaviour.
This commit is contained in:
Phillip Johnsen
2020-07-13 22:20:45 +02:00
committed by GitHub
parent c2daa6ff62
commit f111c4f385
3 changed files with 83 additions and 3 deletions

View File

@@ -130,8 +130,9 @@ export class IssueProcessor {
isPr ? this.options.exemptPrLabels : this.options.exemptIssueLabels
);
const issueType: string = isPr ? 'pr' : 'issue';
const shouldMarkWhenStale = this.options.daysBeforeStale > -1;
if (!staleMessage) {
if (!staleMessage && shouldMarkWhenStale) {
core.info(`Skipping ${issueType} due to empty stale message`);
continue;
}
@@ -165,7 +166,7 @@ export class IssueProcessor {
);
// determine if this issue needs to be marked stale first
if (!isStale && shouldBeStale) {
if (!isStale && shouldBeStale && shouldMarkWhenStale) {
core.info(
`Marking ${issueType} stale because it was last updated on ${issue.updated_at} and it does not have a stale label`
);