fix: Use onetime workdir name (#109)

* chore: Allow to release from not master

* chore(release): 3.0.4-0
* chore(release): 3.0.4-1
This commit is contained in:
Shohei Ueda
2020-02-19 22:56:40 +09:00
committed by GitHub
parent 195ab8005d
commit 2f5ccc92df
6 changed files with 100 additions and 13 deletions

View File

@@ -38,8 +38,12 @@ export async function copyAssets(
return;
}
export async function setRepo(inps: Inputs, remoteURL: string): Promise<void> {
const workDir = path.join(getHomeDir(), 'actions_github_pages');
export async function setRepo(
inps: Inputs,
remoteURL: string,
unixTime: string
): Promise<void> {
const workDir = path.join(getHomeDir(), `actions_github_pages_${unixTime}`);
const publishDir = path.join(
`${process.env.GITHUB_WORKSPACE}`,
inps.PublishDir

View File

@@ -14,7 +14,9 @@ export async function run(): Promise<void> {
const remoteURL = await setTokens(inps);
core.debug(`[INFO] remoteURL: ${remoteURL}`);
await git.setRepo(inps, remoteURL);
const date = new Date();
const unixTime = date.getTime();
await git.setRepo(inps, remoteURL, `${unixTime}`);
try {
await exec.exec('git', ['remote', 'rm', 'origin']);
@@ -31,6 +33,7 @@ export async function run(): Promise<void> {
);
await git.push(inps.PublishBranch, inps.ForceOrphan);
await git.pushTag(inps.TagName, inps.TagMessage);
core.info('[INFO] Action successfully completed');
return;