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:
|
||||
description: 'Skip adding stale message when marking an issue as stale.'
|
||||
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:
|
||||
using: 'node12'
|
||||
main: 'dist/index.js'
|
||||
|
|
|
@ -1464,7 +1464,8 @@ function getAndValidateArgs() {
|
|||
debugOnly: core.getInput('debug-only') === 'true',
|
||||
ascending: core.getInput('ascending') === '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 [
|
||||
'days-before-stale',
|
||||
|
@ -2606,6 +2607,10 @@ class IssueProcessor {
|
|||
core.info(`Skipping ${issueType} because it is locked`);
|
||||
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))) {
|
||||
core.info(`Skipping ${issueType} because it has an exempt label`);
|
||||
continue; // don't process exempt issues
|
||||
|
@ -2710,6 +2715,7 @@ class IssueProcessor {
|
|||
direction: this.options.ascending ? 'asc' : 'desc',
|
||||
page
|
||||
});
|
||||
core.info(`issue data: ${JSON.stringify(issueResult.data)}`);
|
||||
return issueResult.data;
|
||||
}
|
||||
catch (error) {
|
||||
|
|
|
@ -10,6 +10,7 @@ export interface Issue {
|
|||
pull_request: any;
|
||||
state: string;
|
||||
locked: boolean;
|
||||
draft: boolean;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
|
@ -50,6 +51,7 @@ export interface IssueProcessorOptions {
|
|||
ascending: boolean;
|
||||
skipStaleIssueMessage: boolean;
|
||||
skipStalePrMessage: boolean;
|
||||
processDrafts: boolean;
|
||||
}
|
||||
|
||||
/***
|
||||
|
@ -150,6 +152,11 @@ export class IssueProcessor {
|
|||
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: string) =>
|
||||
IssueProcessor.isLabeled(issue, exemptLabel)
|
||||
|
@ -315,6 +322,8 @@ export class IssueProcessor {
|
|||
page
|
||||
}
|
||||
);
|
||||
|
||||
core.info(`issue data: ${JSON.stringify(issueResult.data)}`);
|
||||
return issueResult.data;
|
||||
} catch (error) {
|
||||
core.error(`Get issues for repo error: ${error.message}`);
|
||||
|
|
|
@ -40,7 +40,8 @@ function getAndValidateArgs(): IssueProcessorOptions {
|
|||
debugOnly: core.getInput('debug-only') === 'true',
|
||||
ascending: core.getInput('ascending') === '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 [
|
||||
|
|
Loading…
Reference in New Issue