Skip to content

Commit

Permalink
update format
Browse files Browse the repository at this point in the history
  • Loading branch information
rgychiu committed Nov 17, 2023
1 parent dbbe7c3 commit 981b36a
Show file tree
Hide file tree
Showing 13 changed files with 48,881 additions and 1,683 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ __tests__/runner/*
.vscode
node_modules
coverage/
build
1,088 changes: 1,088 additions & 0 deletions dist/LICENSE

Large diffs are not rendered by default.

39,115 changes: 39,115 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/sourcemap-register.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/index.js

This file was deleted.

10,334 changes: 8,663 additions & 1,671 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "github-action",
"version": "0.0.1",
"description": "GitHub Action for storing CLA signatures",
"main": "lib/main.js",
"main": "build/main.js",
"scripts": {
"test": "jest",
"build": "ncc build ./src/main.ts -o ./lib -m "
"build": "tsc",
"dist": "ncc --source-map --license LICENSE --out dist build"
},
"repository": {
"type": "git",
Expand All @@ -25,11 +26,11 @@
"@types/jest": "^24.0.13",
"@types/node": "^12.0.4",
"@types/node-fetch": "^2.5.7",
"@zeit/ncc": "^0.21.1",
"@vercel/ncc": "^0.38.1",
"jest": "^24.8.0",
"jest-circus": "^24.7.1",
"ts-jest": "^24.2.0",
"typescript": "^3.5.1"
"typescript": "^5.2.2"
},
"author": "ibakshay",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/claFileRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ export class ClaFileRepository {
core.debug("Ran into an error fetching CLA file contents.")

// Only want to catch if the result is a response with a 404 error code, indicating no file was found.
if (error.status === 404) {
if ((error as any).status === 404) {
core.debug("Creating CLA file as it does not currently exist.");
const claFile = new ClaFile();
const createResult = await this.updateClaFile("Creating CLA signature file", claFile);

return [claFile, createResult.data.commit.sha];
} else {
throw new Error(`Failed to get CLA file contents: ${error.message}. Details: ${JSON.stringify(error)}`);
throw new Error(`Failed to get CLA file contents: ${(error as any).message}. Details: ${JSON.stringify(error)}`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function run() {
await runner.execute();
core.info("CLA processing complete.");
} catch (error) {
core.setFailed(`Error: "${error.message}" Details: "${JSON.stringify(error.stack)}"`);
core.setFailed(`Error: "${(error as any).message}" Details: "${JSON.stringify(error)}"`);
}
}
run();
2 changes: 1 addition & 1 deletion src/pullAuthors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ query($owner:String! $name:String! $number:Int! $cursor:String!){
}
return result.repository;
} catch (error) {
throw new Error(`GraphQL query to get commit authors failed: '${error.message}'. Details: ${JSON.stringify(error)} `);
throw new Error(`GraphQL query to get commit authors failed: '${(error as any).message}'. Details: ${JSON.stringify(error)} `);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/pullComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class PullComments {
return result.data.body;
}
} catch (error) {
if (error.status === 403) {
if ((error as any).status === 403) {
// No permissions to write a comment usually indicates this is running from a fork, so give up
// attempting to add or modify the comment.
core.warning("Can't add PR comment because this action executed from a fork. Have anyone add a comment to the PR to execute the action from the primary repository context instead of a fork to add the PR comment.");
Expand All @@ -55,7 +55,7 @@ export class PullComments {
});
return response.data.find(c => c.body.match(this.BotNameRegex));
} catch (error) {
throw new Error(`Failed to get PR comments: ${error.message}. Details: ${JSON.stringify(error)}`);
throw new Error(`Failed to get PR comments: ${(error as any).message}. Details: ${JSON.stringify(error)}`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib",
"outDir": "./build",
/* Redirect output structure to the directory. */
"rootDir": "./src",
/* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
Expand Down

0 comments on commit 981b36a

Please sign in to comment.