mirror of
https://github.com/peakoss/anti-slop
synced 2026-12-01 13:39:13 +08:00
feat(inputs): add all inputs to the getSettings function
This commit is contained in:
1 file changed
+86
@@ -13,6 +13,92 @@ export function getSettings(): Settings {
|
|||||||
const settings = {
|
const settings = {
|
||||||
// Repo Auth Token
|
// Repo Auth Token
|
||||||
githubToken: core.getInput(Input.GithubToken),
|
githubToken: core.getInput(Input.GithubToken),
|
||||||
|
|
||||||
|
// General Settings
|
||||||
|
maxFailures: parseInt(core.getInput(Input.MaxFailures)),
|
||||||
|
actionsStepDebug: core.getBooleanInput(Input.ActionsStepDebug),
|
||||||
|
|
||||||
|
// PR Branch Checks
|
||||||
|
allowedTargetBranches: core.getMultilineInput(Input.AllowedTargetBranches),
|
||||||
|
blockedTargetBranches: core.getMultilineInput(Input.BlockedTargetBranches),
|
||||||
|
allowedSourceBranches: core.getMultilineInput(Input.AllowedSourceBranches),
|
||||||
|
blockedSourceBranches: core.getMultilineInput(Input.BlockedSourceBranches),
|
||||||
|
|
||||||
|
// PR Title Checks
|
||||||
|
requireConventionalTitle: core.getBooleanInput(Input.RequireConventionalTitle),
|
||||||
|
|
||||||
|
// PR Description Checks
|
||||||
|
requireDescription: core.getBooleanInput(Input.RequireDescription),
|
||||||
|
maxDescriptionLength: parseInt(core.getInput(Input.MaxDescriptionLength)),
|
||||||
|
maxEmojiCount: parseInt(core.getInput(Input.MaxEmojiCount)),
|
||||||
|
requirePrTemplate: core.getBooleanInput(Input.RequirePrTemplate),
|
||||||
|
requireLinkedIssue: core.getBooleanInput(Input.RequireLinkedIssue),
|
||||||
|
blockedKeywords: parseList(core.getInput(Input.BlockedKeywords)),
|
||||||
|
blockedIssueNumbers: parseList(core.getInput(Input.BlockedIssueNumbers)),
|
||||||
|
|
||||||
|
// Commit Message Checks
|
||||||
|
requireConventionalCommits: core.getBooleanInput(Input.RequireConventionalCommits),
|
||||||
|
blockedCommitAuthors: parseList(core.getInput(Input.BlockedCommitAuthors)),
|
||||||
|
|
||||||
|
// File Checks
|
||||||
|
allowedFileExtensions: parseList(core.getInput(Input.AllowedFileExtensions)),
|
||||||
|
allowedPaths: core.getMultilineInput(Input.AllowedPaths),
|
||||||
|
blockedPaths: core.getMultilineInput(Input.BlockedPaths),
|
||||||
|
requireFinalNewline: core.getBooleanInput(Input.RequireFinalNewline),
|
||||||
|
allowedLineEnding: core.getInput(Input.AllowedLineEnding),
|
||||||
|
|
||||||
|
// User Health Checks
|
||||||
|
minRepoMergedPrs: parseInt(core.getInput(Input.MinRepoMergedPrs)),
|
||||||
|
minRepoMergeRatio: parseInt(core.getInput(Input.MinRepoMergeRatio)),
|
||||||
|
minGlobalMergeRatio: parseInt(core.getInput(Input.MinGlobalMergeRatio)),
|
||||||
|
minAccountAge: parseInt(core.getInput(Input.MinAccountAge)),
|
||||||
|
|
||||||
|
// Filters
|
||||||
|
// onlyIssueTypes: parseList(core.getInput(Input.OnlyIssueTypes)),
|
||||||
|
// onlyLabels: parseList(core.getInput(Input.OnlyLabels)),
|
||||||
|
// onlyPrLabels: parseList(core.getInput(Input.OnlyPrLabels)),
|
||||||
|
// onlyIssueLabels: parseList(core.getInput(Input.OnlyIssueLabels)),
|
||||||
|
// anyOfLabels: parseList(core.getInput(Input.AnyOfLabels)),
|
||||||
|
// anyOfPrLabels: parseList(core.getInput(Input.AnyOfPrLabels)),
|
||||||
|
// anyOfIssueLabels: parseList(core.getInput(Input.AnyOfIssueLabels)),
|
||||||
|
|
||||||
|
// Exemptions
|
||||||
|
exemptAuthorAssociation: parseList(core.getInput(Input.ExemptAuthorAssociation)),
|
||||||
|
// exemptTeams: parseList(core.getInput(Input.ExemptTeams)),
|
||||||
|
exemptUsers: parseList(core.getInput(Input.ExemptUsers)),
|
||||||
|
exemptBots: core.getMultilineInput(Input.ExemptBots),
|
||||||
|
exemptDraftPrs: core.getBooleanInput(Input.ExemptDraftPrs),
|
||||||
|
exemptLabel: core.getInput(Input.ExemptLabel),
|
||||||
|
exemptPrLabel: core.getInput(Input.ExemptPrLabel),
|
||||||
|
// exemptIssueLabel: core.getInput(Input.ExemptIssueLabel),
|
||||||
|
// exemptMilestones: parseList(core.getInput(Input.ExemptMilestones)),
|
||||||
|
// exemptPrMilestones: parseList(core.getInput(Input.ExemptPrMilestones)),
|
||||||
|
// exemptIssueMilestones: parseList(core.getInput(Input.ExemptIssueMilestones)),
|
||||||
|
// exemptAllMilestones: core.getBooleanInput(Input.ExemptAllMilestones),
|
||||||
|
// exemptAllPrMilestones: core.getBooleanInput(Input.ExemptAllPrMilestones),
|
||||||
|
// exemptAllIssueMilestones: core.getBooleanInput(Input.ExemptAllIssueMilestones),
|
||||||
|
|
||||||
|
// PR Close Actions
|
||||||
|
closePr: core.getBooleanInput(Input.ClosePr),
|
||||||
|
lockPr: core.getBooleanInput(Input.LockPr),
|
||||||
|
deleteBranch: core.getBooleanInput(Input.DeleteBranch),
|
||||||
|
|
||||||
|
// PR Failure Actions
|
||||||
|
failurePrMessage: core.getInput(Input.FailurePrMessage),
|
||||||
|
failureRemovePrLabels: parseList(core.getInput(Input.FailureRemovePrLabels)),
|
||||||
|
failureRemoveAllPrLabels: core.getBooleanInput(Input.FailureRemoveAllPrLabels),
|
||||||
|
failureAddPrLabels: parseList(core.getInput(Input.FailureAddPrLabels)),
|
||||||
|
|
||||||
|
// Issue Close Actions
|
||||||
|
// closeIssue: core.getBooleanInput(Input.CloseIssue),
|
||||||
|
// closeIssueReason: core.getInput(Input.CloseIssueReason),
|
||||||
|
// lockIssue: core.getBooleanInput(Input.LockIssue),
|
||||||
|
|
||||||
|
// Issue Failure Actions
|
||||||
|
// failureIssueMessage: core.getInput(Input.FailureIssueMessage),
|
||||||
|
// failureRemoveIssueLabels: parseList(core.getInput(Input.FailureRemoveIssueLabels)),
|
||||||
|
// failureRemoveAllIssueLabels: core.getBooleanInput(Input.FailureRemoveAllIssueLabels),
|
||||||
|
// failureAddIssueLabels: parseList(core.getInput(Input.FailureAddIssueLabels)),
|
||||||
};
|
};
|
||||||
|
|
||||||
core.setSecret(settings.githubToken);
|
core.setSecret(settings.githubToken);
|
||||||
|
|||||||
Reference in new issue
Block a user