Compare commits
5 Commits
main
...
hross-proc
Author | SHA1 | Date |
---|---|---|
Ross Brodbeck | dcf19effbe | |
Ross Brodbeck | 2392a086f1 | |
Ross Brodbeck | c52e87c95b | |
Ross Brodbeck | 990266dda6 | |
Ross Brodbeck | 5e528060cc |
|
@ -52,6 +52,9 @@ inputs:
|
||||||
skip-stale-issue-message:
|
skip-stale-issue-message:
|
||||||
description: 'Skip adding stale message when marking an issue as stale.'
|
description: 'Skip adding stale message when marking an issue as stale.'
|
||||||
default: false
|
default: false
|
||||||
|
process-drafts:
|
||||||
|
description: 'Should the draft PRs be marked stale? If set to true, draft PRs will be included in processing.'
|
||||||
|
default: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|
|
@ -1464,7 +1464,8 @@ function getAndValidateArgs() {
|
||||||
debugOnly: core.getInput('debug-only') === 'true',
|
debugOnly: core.getInput('debug-only') === 'true',
|
||||||
ascending: core.getInput('ascending') === 'true',
|
ascending: core.getInput('ascending') === 'true',
|
||||||
skipStalePrMessage: core.getInput('skip-stale-pr-message') === 'true',
|
skipStalePrMessage: core.getInput('skip-stale-pr-message') === 'true',
|
||||||
skipStaleIssueMessage: core.getInput('skip-stale-issue-message') === 'true'
|
skipStaleIssueMessage: core.getInput('skip-stale-issue-message') === 'true',
|
||||||
|
processDrafts: core.getInput('process-drafts') === 'true'
|
||||||
};
|
};
|
||||||
for (const numberInput of [
|
for (const numberInput of [
|
||||||
'days-before-stale',
|
'days-before-stale',
|
||||||
|
@ -2606,6 +2607,10 @@ class IssueProcessor {
|
||||||
core.info(`Skipping ${issueType} because it is locked`);
|
core.info(`Skipping ${issueType} because it is locked`);
|
||||||
continue; // don't process locked issues
|
continue; // don't process locked issues
|
||||||
}
|
}
|
||||||
|
if (issue.draft && !this.options.processDrafts) {
|
||||||
|
core.info(`Skipping ${issueType} because it is a draft`);
|
||||||
|
continue; // don't process drafts
|
||||||
|
}
|
||||||
if (exemptLabels.some((exemptLabel) => IssueProcessor.isLabeled(issue, exemptLabel))) {
|
if (exemptLabels.some((exemptLabel) => IssueProcessor.isLabeled(issue, exemptLabel))) {
|
||||||
core.info(`Skipping ${issueType} because it has an exempt label`);
|
core.info(`Skipping ${issueType} because it has an exempt label`);
|
||||||
continue; // don't process exempt issues
|
continue; // don't process exempt issues
|
||||||
|
@ -2710,6 +2715,7 @@ class IssueProcessor {
|
||||||
direction: this.options.ascending ? 'asc' : 'desc',
|
direction: this.options.ascending ? 'asc' : 'desc',
|
||||||
page
|
page
|
||||||
});
|
});
|
||||||
|
core.info(`issue data: ${JSON.stringify(issueResult.data)}`);
|
||||||
return issueResult.data;
|
return issueResult.data;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ export interface Issue {
|
||||||
pull_request: any;
|
pull_request: any;
|
||||||
state: string;
|
state: string;
|
||||||
locked: boolean;
|
locked: boolean;
|
||||||
|
draft: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
|
@ -50,6 +51,7 @@ export interface IssueProcessorOptions {
|
||||||
ascending: boolean;
|
ascending: boolean;
|
||||||
skipStaleIssueMessage: boolean;
|
skipStaleIssueMessage: boolean;
|
||||||
skipStalePrMessage: boolean;
|
skipStalePrMessage: boolean;
|
||||||
|
processDrafts: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
@ -150,6 +152,11 @@ export class IssueProcessor {
|
||||||
continue; // don't process locked issues
|
continue; // don't process locked issues
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (issue.draft && !this.options.processDrafts) {
|
||||||
|
core.info(`Skipping ${issueType} because it is a draft`);
|
||||||
|
continue; // don't process drafts
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
exemptLabels.some((exemptLabel: string) =>
|
exemptLabels.some((exemptLabel: string) =>
|
||||||
IssueProcessor.isLabeled(issue, exemptLabel)
|
IssueProcessor.isLabeled(issue, exemptLabel)
|
||||||
|
@ -315,6 +322,8 @@ export class IssueProcessor {
|
||||||
page
|
page
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
core.info(`issue data: ${JSON.stringify(issueResult.data)}`);
|
||||||
return issueResult.data;
|
return issueResult.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(`Get issues for repo error: ${error.message}`);
|
core.error(`Get issues for repo error: ${error.message}`);
|
||||||
|
|
|
@ -40,7 +40,8 @@ function getAndValidateArgs(): IssueProcessorOptions {
|
||||||
debugOnly: core.getInput('debug-only') === 'true',
|
debugOnly: core.getInput('debug-only') === 'true',
|
||||||
ascending: core.getInput('ascending') === 'true',
|
ascending: core.getInput('ascending') === 'true',
|
||||||
skipStalePrMessage: core.getInput('skip-stale-pr-message') === 'true',
|
skipStalePrMessage: core.getInput('skip-stale-pr-message') === 'true',
|
||||||
skipStaleIssueMessage: core.getInput('skip-stale-issue-message') === 'true'
|
skipStaleIssueMessage: core.getInput('skip-stale-issue-message') === 'true',
|
||||||
|
processDrafts: core.getInput('process-drafts') === 'true'
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const numberInput of [
|
for (const numberInput of [
|
||||||
|
|
Loading…
Reference in New Issue