abort the build on the error

This commit is contained in:
Sergey Dolin 2023-02-10 00:44:47 +01:00
parent 7769eadff1
commit 6bc202284c
4 changed files with 6657 additions and 12268 deletions

6395
dist/index.js vendored

File diff suppressed because one or more lines are too long

8168
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,9 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/github": "^5.0.1", "@actions/github": "^5.1.1",
"@octokit/core": "^4.2.0",
"@octokit/plugin-retry": "^4.1.1",
"lodash.deburr": "^4.1.0", "lodash.deburr": "^4.1.0",
"semver": "^7.3.5" "semver": "^7.3.5"
}, },

View File

@ -25,6 +25,7 @@ import {StaleOperations} from './stale-operations';
import {Statistics} from './statistics'; import {Statistics} from './statistics';
import {LoggerService} from '../services/logger.service'; import {LoggerService} from '../services/logger.service';
import {OctokitIssue} from '../interfaces/issue'; import {OctokitIssue} from '../interfaces/issue';
import {retry} from '@octokit/plugin-retry';
/*** /***
* Handle processing of issues for staleness/closure. * Handle processing of issues for staleness/closure.
@ -74,7 +75,7 @@ export class IssuesProcessor {
constructor(options: IIssuesProcessorOptions) { constructor(options: IIssuesProcessorOptions) {
this.options = options; this.options = options;
this.client = getOctokit(this.options.repoToken); this.client = getOctokit(this.options.repoToken, {}, retry);
this.operations = new StaleOperations(this.options); this.operations = new StaleOperations(this.options);
this._logger.info( this._logger.info(
@ -556,8 +557,7 @@ export class IssuesProcessor {
(issue: Readonly<OctokitIssue>): Issue => new Issue(this.options, issue) (issue: Readonly<OctokitIssue>): Issue => new Issue(this.options, issue)
); );
} catch (error) { } catch (error) {
this._logger.error(`Get issues for repo error: ${error.message}`); throw Error(`Get issues for repo error: ${error.message}`);
return Promise.resolve([]);
} }
} }