cleanup async parameter

This commit is contained in:
Frostebite 2023-11-18 17:16:26 +00:00
parent df4cc41418
commit e296ef2dc1
6 changed files with 15 additions and 34 deletions

View File

@ -1,22 +1,11 @@
{
"plugins": [
"jest",
"@typescript-eslint",
"prettier",
"unicorn"
],
"extends": [
"plugin:unicorn/recommended",
"plugin:github/recommended",
"plugin:prettier/recommended"
],
"plugins": ["jest", "@typescript-eslint", "prettier", "unicorn"],
"extends": ["plugin:unicorn/recommended", "plugin:github/recommended", "plugin:prettier/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"extraFileExtensions": [
".mjs"
],
"extraFileExtensions": [".mjs"],
"ecmaFeatures": {
"impliedStrict": true
},
@ -33,10 +22,7 @@
// Namespaces or sometimes needed
"import/no-namespace": "off",
// Properly format comments
"spaced-comment": [
"error",
"always"
],
"spaced-comment": ["error", "always"],
"lines-around-comment": [
"error",
{
@ -71,12 +57,7 @@
// Enforce camelCase
"camelcase": "error",
// Allow forOfStatements
"no-restricted-syntax": [
"error",
"ForInStatement",
"LabeledStatement",
"WithStatement"
],
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"],
// Continue is viable in forOf loops in generators
"no-continue": "off",
// From experience, named exports are almost always desired. I got tired of this rule

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -39,11 +39,11 @@ describe('Cloud Runner Github Checks', () => {
asyncCloudRunner: `true`,
githubChecks: `true`,
});
GitHub.asyncWorkflows = true;
GitHub.forceAsyncTest = true;
await CloudRunner.setup(buildParameter);
CloudRunner.buildParameters.githubCheckId = await GitHub.createGitHubCheck(`t`);
await GitHub.updateGitHubCheck(`t`, `t2`);
GitHub.asyncWorkflows = false;
GitHub.forceAsyncTest = false;
}, 1_000_000_000);
}
});

View File

@ -11,7 +11,7 @@ class GitHub {
private static startedDate: string;
private static endedDate: string;
static result: string = ``;
static asyncWorkflows: boolean;
static forceAsyncTest: boolean;
private static get octokitDefaultToken() {
return new Octokit({
auth: process.env.GITHUB_TOKEN,
@ -128,7 +128,7 @@ class GitHub {
data.conclusion = result;
}
await (CloudRunner.isCloudRunnerAsyncEnvironment || GitHub.asyncWorkflows
await (CloudRunner.isCloudRunnerAsyncEnvironment || GitHub.forceAsyncTest
? GitHub.runUpdateAsyncChecksWorkflow(data, `update`)
: GitHub.updateGitHubCheckRequest(data));
}