We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
noUncheckedIndexedAccess
1 parent c427daf commit ac357eaCopy full SHA for ac357ea
github_actions.ts
@@ -2,9 +2,15 @@
2
3
import { Octokit } from "npm:octokit@^3.1";
4
5
-export function getGitHubRepository() {
+export function getGitHubRepository(): { owner: string, repo: string } {
6
const repoEnvVar = getEnvVarOrThrow("GITHUB_REPOSITORY");
7
const [owner, repo] = repoEnvVar.split("/");
8
+ if (repo === undefined) {
9
+ throw new Error(
10
+ `Environment variable GITHUB_REPOSITORY ` +
11
+ `must be formatted as "{owner}/{repo}".`,
12
+ );
13
+ }
14
return {
15
owner,
16
repo,
0 commit comments