mirror of
https://github.com/actions/stale.git
synced 2025-12-11 20:47:10 +00:00
feat(output): print output parameters (#458)
* ✨ print output parameters * 📝 add output table * ⚗️ try output parameters * ⚗️ stringify output * ⚗️ try test output * 🔥 remove test output * 💚 build and lint code * 🔥 remove output test * 🔒 fix vulnerabilities * 🎨 renaming staled variables * 🎨 build code * 📝 update contributing commands
This commit is contained in:
17
src/main.ts
17
src/main.ts
@@ -2,12 +2,19 @@ import * as core from '@actions/core';
|
||||
import {IssuesProcessor} from './classes/issues-processor';
|
||||
import {isValidDate} from './functions/dates/is-valid-date';
|
||||
import {IIssuesProcessorOptions} from './interfaces/issues-processor-options';
|
||||
import {Issue} from './classes/issue';
|
||||
|
||||
async function _run(): Promise<void> {
|
||||
try {
|
||||
const args = _getAndValidateArgs();
|
||||
|
||||
await new IssuesProcessor(args).processIssues();
|
||||
const issueProcessor: IssuesProcessor = new IssuesProcessor(args);
|
||||
await issueProcessor.processIssues();
|
||||
|
||||
await processOutput(
|
||||
issueProcessor.closedIssues,
|
||||
issueProcessor.staleIssues
|
||||
);
|
||||
} catch (error) {
|
||||
core.error(error);
|
||||
core.setFailed(error.message);
|
||||
@@ -103,6 +110,14 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||
return args;
|
||||
}
|
||||
|
||||
async function processOutput(
|
||||
staledIssues: Issue[],
|
||||
closedIssues: Issue[]
|
||||
): Promise<void> {
|
||||
core.setOutput('staled-issues-prs', JSON.stringify(staledIssues));
|
||||
core.setOutput('closed-issues-prs', JSON.stringify(closedIssues));
|
||||
}
|
||||
|
||||
function _toOptionalBoolean(
|
||||
argumentName: Readonly<string>
|
||||
): boolean | undefined {
|
||||
|
||||
Reference in New Issue
Block a user