Skip to content

Commit ac357ea

Browse files
authored
refactor: prepare deno std for noUncheckedIndexedAccess (#43)
1 parent c427daf commit ac357ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

github_actions.ts

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

33
import { Octokit } from "npm:octokit@^3.1";
44

5-
export function getGitHubRepository() {
5+
export function getGitHubRepository(): { owner: string, repo: string } {
66
const repoEnvVar = getEnvVarOrThrow("GITHUB_REPOSITORY");
77
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+
}
814
return {
915
owner,
1016
repo,

0 commit comments

Comments
 (0)