mirror of
https://github.com/actions/stale.git
synced 2025-12-12 04:57:15 +00:00
chore(logs): enhance the logs (#358)
* docs(only-labels): enhance the docs and fix duplicate (#341) * docs(only-labels): remove duplicated option and improve descriptions a bad rebase happend * docs(readme): use a multi-line array and remove the optional column the option column was not helpful since each value is optional the multi-line array will allow to have a better UI in small devices and basically in GitHub too due to the max-width * style(readme): break line for the statistics * docs(readme): add a better description for the ascending option * docs(action): add missing punctuation * build(deps-dev): bump @typescript-eslint/eslint-plugin (#342) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.2 to 4.16.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump @octokit/rest from 18.3.0 to 18.3.2 (#350) Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.0 to 18.3.2. - [Release notes](https://github.com/octokit/rest.js/releases) - [Commits](https://github.com/octokit/rest.js/compare/v18.3.0...v18.3.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * test: add more coverage for the stale label behaviour (#352) (#15) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(logs): add logs for the milestones * chore(errors): use actions error instead of throw errors * chore(logs): enhance the logs and add some colors tl;dr: blue for values, megenta for options, white for messages, yellow light for warnings, yellow for milestones and green for success still a WIP but I wish to confirm this before continuing @hross is it ok for you? * chore(index): update the index * chore(ci): use npm ci instead of npm i * chore(logs): removed some useless logs * refactor(issues): remove useless check * chore(statistics): show the real count of fetched issues * refactor(operations): use a class to handle the operations left closes #361 * chore(logs): include the total number of issues in the log for a batch Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3b3c3f03cd
commit
b717aa9f47
13
src/main.ts
13
src/main.ts
@@ -7,8 +7,7 @@ async function _run(): Promise<void> {
|
||||
try {
|
||||
const args = _getAndValidateArgs();
|
||||
|
||||
const processor: IssuesProcessor = new IssuesProcessor(args);
|
||||
await processor.processIssues();
|
||||
await new IssuesProcessor(args).processIssues();
|
||||
} catch (error) {
|
||||
core.error(error);
|
||||
core.setFailed(error.message);
|
||||
@@ -78,7 +77,9 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||
'operations-per-run'
|
||||
]) {
|
||||
if (isNaN(parseInt(core.getInput(numberInput)))) {
|
||||
throw Error(`input ${numberInput} did not parse to a valid integer`);
|
||||
core.setFailed(
|
||||
new Error(`Option "${numberInput}" did not parse to a valid integer`)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +87,10 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||
// Ignore empty dates because it is considered as the right type for a default value (so a valid one)
|
||||
if (core.getInput(optionalDateInput) !== '') {
|
||||
if (!isValidDate(new Date(core.getInput(optionalDateInput)))) {
|
||||
throw new Error(
|
||||
`input ${optionalDateInput} did not parse to a valid date`
|
||||
core.setFailed(
|
||||
new Error(
|
||||
`Option "${optionalDateInput}" did not parse to a valid date`
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user