ede6c15881
This adds support for this action to be used in GitHub Enterprise Server. It sends request to the base url extracted from [GITHUB_API_URL](https://docs.github.com/en/enterprise-server@3.10/actions/learn-github-actions/variables#default-environment-variables). --------- Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
31 lines
665 B
JavaScript
31 lines
665 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.defaults({
|
|
baseUrl: process.env["GITHUB_API_URL"],
|
|
})
|
|
).catch((error) => {
|
|
console.error(error);
|
|
core.setFailed(error.message);
|
|
});
|