-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from contributor-assistant/error-handling-for…
…k-fix Bug fix: Fail gracefully when Pr is created from fork
- Loading branch information
Showing
5 changed files
with
150 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import { getOctokit } from '@actions/github' | ||
|
||
const githubActionsDefaultToken = process.env.GITHUB_TOKEN | ||
const personalAcessToken = process.env.PERSONAL_ACCESS_TOKEN as string | ||
const personalAccessToken = process.env.PERSONAL_ACCESS_TOKEN as string | ||
|
||
export const octokit = getOctokit(githubActionsDefaultToken as string) | ||
export const octokitUsingPAT = isPersonalAccessTokenPresent() ? getOctokit(personalAcessToken as string) : octokit | ||
export const octokitUsingPAT = isPersonalAccessTokenPresent() ? getOctokit(personalAccessToken as string) : octokit | ||
|
||
export function isPersonalAccessTokenPresent(): boolean { | ||
|
||
return (typeof personalAcessToken !== "undefined") | ||
return personalAccessToken !== "" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters