Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit 0c895ba

Browse files
authored
Upgrade dependencies (#10)
1 parent c194166 commit 0c895ba

File tree

5 files changed

+400
-619
lines changed

5 files changed

+400
-619
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
This [JavaScript GitHub Action](https://help.github.com/en/actions/building-actions/about-actions#javascript-actions) can be used to impersonate a GitHub App when `secrets.GITHUB_TOKEN`'s limitations are too restrictive and a personal access token is not suitable.
44

5-
[`secrets.GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) has limitations such as [not being able to triggering a new workflow from another workflow](https://github.community/t5/GitHub-Actions/Triggering-a-new-workflow-from-another-workflow/td-p/31676). A workaround is to use a [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) from a [personal user/bot account](https://help.github.com/en/github/getting-started-with-github/types-of-github-accounts#personal-user-accounts). However, for organizations, GitHub Apps are [a more appropriate automation solution](https://developer.github.com/apps/differences-between-apps/#machine-vs-bot-accounts).
5+
[`secrets.GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) has limitations such as [not being able to triggering a new workflow from another workflow](https://github.community/t5/GitHub-Actions/Triggering-a-new-workflow-from-another-workflow/td-p/31676).
6+
A workaround is to use a [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) from a [personal user/bot account](https://help.github.com/en/github/getting-started-with-github/types-of-github-accounts#personal-user-accounts).
7+
However, for organizations, GitHub Apps are [a more appropriate automation solution](https://developer.github.com/apps/differences-between-apps/#machine-vs-bot-accounts).
68

79
# Example Workflow
810

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-app-token",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"license": "MIT",
55
"files": [
66
"action.yml",
@@ -15,26 +15,26 @@
1515
"prettier": "prettier --ignore-path .gitignore \"./**/*.{js,json,md,ts,yml}\""
1616
},
1717
"devDependencies": {
18-
"@actions/core": "^1.2.5",
18+
"@actions/core": "^1.2.6",
1919
"@actions/github": "^4.0.0",
20-
"@octokit/app": "^4.2.1",
20+
"@octokit/app": "^4.3.0",
2121
"@types/is-base64": "^1.1.0",
22-
"@types/node": "^14.6.4",
23-
"@typescript-eslint/eslint-plugin": "^4.0.1",
24-
"@typescript-eslint/parser": "^4.0.1",
25-
"@vercel/ncc": "^0.24.0",
26-
"eslint": "^7.8.1",
27-
"eslint-config-prettier": "^6.11.0",
28-
"eslint-config-xo": "^0.32.1",
29-
"eslint-config-xo-typescript": "^0.32.0",
22+
"@types/node": "^14.14.6",
23+
"@typescript-eslint/eslint-plugin": "^4.6.0",
24+
"@typescript-eslint/parser": "^4.6.0",
25+
"@vercel/ncc": "^0.24.1",
26+
"eslint": "^7.12.1",
27+
"eslint-config-prettier": "^6.15.0",
28+
"eslint-config-xo": "^0.33.1",
29+
"eslint-config-xo-typescript": "^0.35.0",
3030
"eslint-import-resolver-typescript": "^2.3.0",
31-
"eslint-plugin-import": "^2.22.0",
31+
"eslint-plugin-import": "^2.22.1",
3232
"eslint-plugin-sort-destructure-keys": "^1.3.5",
33-
"eslint-plugin-typescript-sort-keys": "^1.3.0",
34-
"eslint-plugin-unicorn": "^21.0.0",
33+
"eslint-plugin-typescript-sort-keys": "^1.5.0",
34+
"eslint-plugin-unicorn": "^23.0.0",
3535
"is-base64": "^1.1.0",
36-
"prettier": "^2.1.1",
36+
"prettier": "^2.1.2",
3737
"promise-retry": "^2.0.1",
38-
"typescript": "^4.0.2"
38+
"typescript": "^4.0.5"
3939
}
4040
}

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ const run = async () => {
2929
setSecret(token);
3030
setOutput("token", token);
3131
info("Token generated successfully!");
32-
} catch (error) {
33-
logError(error);
34-
setFailed(error.message);
32+
} catch (error: unknown) {
33+
if (typeof error !== "string" && !(error instanceof Error)) {
34+
throw new TypeError(`Caught error of unexpected type: ${typeof error}`);
35+
}
36+
37+
setFailed(error);
3538
}
3639
};
3740

0 commit comments

Comments
 (0)