@@ -21,55 +21,37 @@ export async function init(action: ActionInterface): Promise<void | Error> {
21
21
info ( `Deploying using ${ action . tokenType } … 🔑` )
22
22
info ( 'Configuring git…' )
23
23
24
- async function configure ( throwOnError : boolean ) {
25
- try {
26
- await execute (
27
- `git config --global --add safe.directory "${ action . workspace } "` ,
28
- action . workspace ,
29
- action . silent
30
- )
24
+ await execute ( `git init` , action . workspace , action . silent )
31
25
32
- await execute (
33
- `git config user.name " ${ action . name } " ` ,
34
- action . workspace ,
35
- action . silent
36
- )
26
+ await execute (
27
+ `git commit -m "Initial commit" --allow-empty ` ,
28
+ action . workspace ,
29
+ action . silent
30
+ )
37
31
38
- await execute (
39
- `git config user.email "${ action . email } "` ,
40
- action . workspace ,
41
- action . silent
42
- )
32
+ await execute (
33
+ `git config --global --add safe.directory "${ action . workspace } "` ,
34
+ action . workspace ,
35
+ action . silent
<
10000
td data-grid-cell-id="diff-2ea4750851b34def3ddd617afa64e175a87064a29dbb9e6fd20eee6f1dd6dc93-42-36-1" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">36
+ )
43
37
44
- await execute (
45
- `git config core.ignorecase false` ,
46
- action . workspace ,
47
- action . silent
48
- )
49
- } catch {
50
- info (
51
- 'There was a problemissue initilizing git, attempting to resolve …'
52
- )
53
- if ( throwOnError ) {
54
- throw new Error ( )
55
- }
56
- }
57
- }
38
+ await execute (
39
+ `git config user.name "${ action . name } "` ,
40
+ action . workspace ,
41
+ action . silent
42
+ )
58
43
59
- try {
60
- await configure ( false )
61
- } catch {
62
- // Attempt to re-run if initial configuration failed using git init.
63
- await execute ( `git init` , action . workspace , action . silent )
44
+ await execute (
45
+ `git config user.email " ${ action . email } "` ,
46
+ action . workspace ,
47
+ action . silent
48
+ )
64
49
65
- await execute (
66
- `git commit -m "Initial commit" --allow-empty` ,
67
- action . workspace ,
68
- action . silent
69
- )
70
-
71
- await configure ( true )
72
- }
50
+ await execute (
51
+ `git config core.ignorecase false` ,
52
+ action . workspace ,
53
+ action . silent
54
+ )
73
55
74
56
try {
75
57
if ( ( process . env . CI && ! action . sshKey ) || action . isTest ) {
0 commit comments