Add exemption for processing draft PRs
This commit is contained in:
parent
23eab295e2
commit
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'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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