mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-14 22:29:17 +08:00
fix: Use path.resolve for inps.PublishDir not path.join
This commit is contained in:
parent
f8d2ed3863
commit
f06738911c
@ -43,7 +43,7 @@ export async function copyAssets(
|
||||
|
||||
const dotGitPath = path.join(publishDir, '.git');
|
||||
if (fs.existsSync(dotGitPath)) {
|
||||
core.info(`[INFO] delete .git`);
|
||||
core.info(`[INFO] delete ${dotGitPath}`);
|
||||
io.rmRF(dotGitPath);
|
||||
}
|
||||
|
||||
@ -57,8 +57,8 @@ export async function copyAssets(
|
||||
|
||||
export async function setRepo(inps: Inputs, remoteURL: string, workDir: string): Promise<void> {
|
||||
const publishDir = path.isAbsolute(inps.PublishDir)
|
||||
? inps.PublishDir
|
||||
: path.join(`${process.env.GITHUB_WORKSPACE}`, inps.PublishDir);
|
||||
? path.resolve(inps.PublishDir)
|
||||
: path.resolve(`${process.env.GITHUB_WORKSPACE}`, inps.PublishDir);
|
||||
|
||||
if (path.isAbsolute(inps.DestinationDir)) {
|
||||
throw new Error('destination_dir should be a relative path');
|
||||
|
Loading…
x
Reference in New Issue
Block a user