Skip to content

Commit a375861

Browse files
committed
read from env var
1 parent 7cc7551 commit a375861

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/post-preview-url-comment/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ import { filenameToPath } from "./util";
1515

1616
async function run(): Promise<void> {
1717
try {
18-
const token = core.getInput("GITHUB_TOKEN", { required: true });
19-
const octokit = github.getOctokit(token);
18+
if (!process.env.GITHUB_TOKEN) {
19+
core.setFailed(`Could not find GITHUB_TOKEN in env`);
20+
process.exit();
21+
}
22+
23+
const octokit = github.getOctokit(process.env.GITHUB_TOKEN);
2024
const ctx = github.context;
2125

2226
const { data: pulls } = await octokit.rest.pulls.list({

0 commit comments

Comments
 (0)