2019-11-19 23:06:27 +08:00
|
|
|
import * as core from "@actions/core";
|
|
|
|
import * as github from "@actions/github";
|
|
|
|
|
|
|
|
const { pusher, repository } = github.context.payload;
|
|
|
|
|
|
|
|
export const workspace: any = process.env.GITHUB_WORKSPACE;
|
|
|
|
export const folder = core.getInput("FOLDER", { required: true });
|
|
|
|
export const root = ".";
|
2019-11-20 22:13:01 +08:00
|
|
|
export const isTest = process.env.UNIT_TEST;
|
2019-11-19 23:06:27 +08:00
|
|
|
|
|
|
|
// Required action data.
|
|
|
|
export const action = {
|
|
|
|
build: folder,
|
2019-11-21 22:29:43 +08:00
|
|
|
gitHubRepository:
|
|
|
|
repository && repository.full_name
|
|
|
|
? repository.full_name
|
|
|
|
: process.env.GITHUB_REPOSITORY,
|
2019-11-19 23:06:27 +08:00
|
|
|
gitHubToken: core.getInput("GITHUB_TOKEN"),
|
|
|
|
accessToken: core.getInput("ACCESS_TOKEN"),
|
|
|
|
branch: core.getInput("BRANCH"),
|
|
|
|
baseBranch: core.getInput("BASE_BRANCH") || "master",
|
|
|
|
pusher
|
|
|
|
};
|
|
|
|
|
|
|
|
// Repository path used for commits/pushes.
|
|
|
|
export const repositoryPath = `https://${action.accessToken ||
|
|
|
|
`x-access-token:${action.gitHubToken}`}@github.com/${
|
|
|
|
action.gitHubRepository
|
|
|
|
}.git`;
|