8000 Deploy Production Code for Commit 781d9e3cedb923cbb8be9b91dfae4a40c47… · ushmm/github-pages-deploy-action@c914d06 · GitHub
[go: up one dir, main page]

Skip to content

Commit c914d06

Browse files
committed
Deploy Production Code for Commit 781d9e3 🚀
1 parent 781d9e3 commit c914d06

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

lib/git.js

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,12 @@ function init(action) {
2626
try {
2727
(0, core_1.info)(`Deploying using ${action.tokenType}… 🔑`);
2828
(0, core_1.info)('Configuring git…');
29-
function configure(throwOnError) {
30-
return __awaiter(this, void 0, void 0, function* () {
31-
try {
32-
yield (0, execute_1.execute)(`git config --global --add safe.directory "${action.workspace}"`, action.workspace, action.silent);
33-
yield (0, execute_1.execute)(`git config user.name "${action.name}"`, action.workspace, action.silent);
34-
yield (0, execute_1.execute)(`git config user.email "${action.email}"`, action.workspace, action.silent);
35-
yield (0, execute_1.execute)(`git config core.ignorecase false`, action.workspace, action.silent);
36-
}
37-
catch (_a) {
38-
(0, core_1.info)('There was a problemissue initilizing git, attempting to resolve …');
39-
if (throwOnError) {
40-
throw new Error();
41-
}
42-
}
43-
});
44-
}
45-
try {
46-
yield configure(false);
47-
}
48-
catch (_a) {
49-
// Attempt to re-run if initial configuration failed using git init.
50-
yield (0, execute_1.execute)(`git init`, action.workspace, action.silent);
51-
yield (0, execute_1.execute)(`git commit -m "Initial commit" --allow-empty`, action.workspace, action.silent);
52-
yield configure(true);
53-
}
29+
yield (0, execute_1.execute)(`git init`, action.workspace, action.silent);
30+
yield (0, execute_1.execute)(`git commit -m "Initial commit" --allow-empty`, action.workspace, action.silent);
31+
yield (0, execute_1.execute)(`git config --global --add safe.directory "${action.workspace}"`, action.workspace, action.silent);
32+
yield (0, execute_1.execute)(`git config user.name "${action.name}"`, action.workspace, action.silent);
33+
yield (0, execute_1.execute)(`git config user.email "${action.email}"`, action.workspace, action.silent);
34+
yield (0, execute_1.execute)(`git config core.ignorecase false`, action.workspace, action.silent);
5435
try {
5536
if ((process.env.CI && !action.sshKey) || action.isTest) {
5637
/* Ensures that previously set Git configs do not interfere with the deployment.
@@ -62,7 +43,7 @@ function init(action) {
6243
throw new Error();
6344
}
6445
}
65-
catch (_b) {
46+
catch (_a) {
6647
(0, core_1.info)('Unable to unset previous git config authentication as it may not exist, continuing…');
6748
}
6849
try {
@@ -71,7 +52,7 @@ function init(action) {
7152
throw new Error();
7253
}
7354
}
74-
catch (_c) {
55+
catch (_b) {
7556
(0, core_1.info)('Attempted to remove origin but failed, continuing…');
7657
}
7758
yield (0, execute_1.execute)(`git remote add origin ${action.repositoryPath}`, action.workspace, action.silent);

0 commit comments

Comments
 (0)
0