mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
771cc5a24a
* Bump @actions/exec from 1.0.1 to 1.0.2 Bumps [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/actions/toolkit/releases) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/exec) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Adds target directory * Target Folder Docs
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
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 = ".";
|
|
export const isTest = process.env.UNIT_TEST;
|
|
|
|
// Required action data.
|
|
export const action = {
|
|
build: folder,
|
|
gitHubRepository:
|
|
repository && repository.full_name
|
|
? repository.full_name
|
|
: process.env.GITHUB_REPOSITORY,
|
|
gitHubToken: core.getInput("GITHUB_TOKEN"),
|
|
accessToken: core.getInput("ACCESS_TOKEN"),
|
|
branch: core.getInput("BRANCH"),
|
|
targetFolder: core.getInput("TARGET_FOLDER"),
|
|
baseBranch: core.getInput("BASE_BRANCH") || "master",
|
|
name:
|
|
pusher && pusher.name
|
|
? pusher.name
|
|
: process.env.GITHUB_ACTOR
|
|
? process.env.GITHUB_ACTOR
|
|
: "GitHub Pages Deploy Action",
|
|
email:
|
|
pusher && pusher.email
|
|
? pusher.email
|
|
: `${process.env.GITHUB_ACTOR ||
|
|
"github-pages-deploy-action"}@users.noreply.github.com`,
|
|
clean: core.getInput("CLEAN")
|
|
};
|
|
|
|
// Repository path used for commits/pushes.
|
|
export const repositoryPath = `https://${action.accessToken ||
|
|
`x-access-token:${action.gitHubToken}`}@github.com/${
|
|
action.gitHubRepository
|
|
}.git`;
|