Files
create-github-app-token/main.js
T
Gregor Martynus f45685208f feat: initial version (#1)
Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
Co-authored-by: Gregor Martynus <gr2m@users.noreply.github.com>
2023-06-08 17:04:10 -07:00

24 lines
601 B
JavaScript

// @ts-check
import core from "@actions/core";
import { createAppAuth } from "@octokit/auth-app";
import { request } from "@octokit/request";
import { main } from "./lib/main.js";
if (!process.env.GITHUB_REPOSITORY) {
throw new Error("GITHUB_REPOSITORY missing, must be set to '<owner>/<repo>'");
}
const appId = core.getInput("app_id");
const privateKey = core.getInput("private_key");
const repository = process.env.GITHUB_REPOSITORY;
main(appId, privateKey, repository, core, createAppAuth, request).catch(
(error) => {
console.error(error);
core.setFailed(error.message);
}
);