File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,10 @@ export async function copyAssets(
40
40
41
41
export async function setRepo (
42
42
inps : Inputs ,
43
- remoteURL : string
44
- ) : Promise < string > {
45
- const workDir = path . join ( getHomeDir ( ) , 'actions_github_pages' ) ;
43
+ remoteURL : string ,
44
+ unixTime : string
45
+ ) : Promise < void > {
46
+ const workDir = path . join ( getHomeDir ( ) , `actions_github_pages_${ unixTime } ` ) ;
46
47
const publishDir = path . join (
47
48
`${ process . env . GITHUB_WORKSPACE } ` ,
48
49
inps . PublishDir
@@ -54,7 +55,7 @@ export async function setRepo(
54
55
process . chdir ( workDir ) ;
55
56
await createBranchForce ( inps . PublishBranch ) ;
56
57
await copyAssets ( publishDir , workDir ) ;
57
- return workDir ;
58
+ return ;
58
59
}
59
60
60
61
const result : CmdResult = {
@@ -92,7 +93,7 @@ export async function setRepo(
92
93
}
93
94
94
95
await copyAssets ( publishDir , workDir ) ;
95
- return workDir ;
96
+ return ;
96
97
} else {
97
98
throw new Error ( `Failed to clone remote branch ${ inps . PublishBranch } ` ) ;
98
99
}
@@ -105,7 +106,7 @@ export async function setRepo(
105
106
process . chdir ( workDir ) ;
106
107
await createBranchForce ( inps . PublishBranch ) ;
107
108
await copyAssets ( publishDir , workDir ) ;
108
- return workDir ;
109
+ return ;
109
110
}
110
111
}
111
112
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core' ;
2
2
import * as exec from '@actions/exec' ;
3
- import * as io from '@actions/io' ;
4
3
import { Inputs } from './interfaces' ;
5
4
import { getInputs } from './get-inputs' ;
6
5
import { setTokens } from './set-tokens' ;
@@ -15,7 +14,9 @@ export async function run(): Promise<void> {
15
14
const remoteURL = await setTokens ( inps ) ;
16
15
core . debug ( `[INFO] remoteURL: ${ remoteURL } ` ) ;
17
16
18
- const workDir = await git . setRepo ( inps , remoteURL ) ;
17
+ const date = new Date ( ) ;
18
+ const unixTime = date . getTime ( ) ;
19
+ await git . setRepo ( inps , remoteURL , unixTime ) ;
19
20
20
21
try {
21
22
await exec . exec ( 'git' , [ 'remote' , 'rm' , 'origin' ] ) ;
@@ -33,9 +34,6 @@ export async function run(): Promise<void> {
33
34
await git . push ( inps . PublishBranch , inps . ForceOrphan ) ;
34
35
await git . pushTag ( inps . TagName , inps . TagMessage ) ;
35
36
36
- core . info ( `[INFO] Deleting ${ workDir } ` ) ;
37
- await io . rmRF ( workDir ) ;
38
-
39
37
core . info ( '[INFO] Action successfully completed' ) ;
40
38
41
39
return ;
You can’t perform that action at this time.
0 commit comments