Skip to content
Permalink
4d89a385db
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
70 lines (63 sloc) 2.42 KB
import * as core from '@actions/core';
import {Inputs} from './interfaces';
export function showInputs(inps: Inputs): void {
let authMethod = '';
if (inps.DeployKey) {
authMethod = 'DeployKey';
} else if (inps.GithubToken) {
authMethod = 'GithubToken';
} else if (inps.PersonalToken) {
authMethod = 'PersonalToken';
}
core.info(`\
[INFO] ${authMethod}: true
[INFO] PublishBranch: ${inps.PublishBranch}
[INFO] PublishDir: ${inps.PublishDir}
[INFO] ExternalRepository: ${inps.ExternalRepository}
[INFO] AllowEmptyCommit: ${inps.AllowEmptyCommit}
[INFO] KeepFiles: ${inps.KeepFiles}
[INFO] ForceOrphan: ${inps.ForceOrphan}
[INFO] UserName: ${inps.UserName}
[INFO] UserEmail: ${inps.UserEmail}
[INFO] CommitMessage: ${inps.CommitMessage}
[INFO] FullCommitMessage: ${inps.FullCommitMessage}
[INFO] TagName: ${inps.TagName}
[INFO] TagMessage: ${inps.TagMessage}
[INFO] EnableJekyll (DisableNoJekyll): ${inps.DisableNoJekyll}
[INFO] CNAME: ${inps.CNAME}
`);
}
export function getInputs(): Inputs {
let useBuiltinJekyll = false;
const enableJekyll: boolean =
(core.getInput('enable_jekyll') || 'false').toUpperCase() === 'TRUE';
const disableNoJekyll: boolean =
(core.getInput('disable_nojekyll') || 'false').toUpperCase() === 'TRUE';
if (enableJekyll && disableNoJekyll) {
throw new Error(`Use either of enable_jekyll or disable_nojekyll`);
} else if (enableJekyll) {
useBuiltinJekyll = true;
} else if (disableNoJekyll) {
useBuiltinJekyll = true;
}
const inps: Inputs = {
DeployKey: core.getInput('deploy_key'),
GithubToken: core.getInput('github_token'),
PersonalToken: core.getInput('personal_token'),
PublishBranch: core.getInput('publish_branch'),
PublishDir: core.getInput('publish_dir'),
ExternalRepository: core.getInput('external_repository'),
AllowEmptyCommit: (core.getInput('allow_empty_commit') || 'false').toUpperCase() === 'TRUE',
KeepFiles: (core.getInput('keep_files') || 'false').toUpperCase() === 'TRUE',
ForceOrphan: (core.getInput('force_orphan') || 'false').toUpperCase() === 'TRUE',
UserName: core.getInput('user_name'),
UserEmail: core.getInput('user_email'),
CommitMessage: core.getInput('commit_message'),
FullCommitMessage: core.getInput('full_commit_message'),
TagName: core.getInput('tag_name'),
TagMessage: core.getInput('tag_message'),
DisableNoJekyll: useBuiltinJekyll,
CNAME: core.getInput('cname')
};
return inps;
}