From b8de13298289655dacb1ce972d5d5f548d04456a Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:11:49 +0700 Subject: [PATCH 1/4] push not fail when pre-push failed --- libraries/rush-lib/src/logic/base/BaseInstallManager.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts index ae2ee615e67..3c56a5e86b7 100644 --- a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts +++ b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts @@ -483,6 +483,7 @@ fi : ''; const hookFileContent: string = `#!/bin/bash +set -e SCRIPT_DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" SCRIPT_IMPLEMENTATION_PATH="$SCRIPT_DIR/${hookRelativePath}/${filename}" From d5bc48c16b6f721afe6d907ef17f473fb278f48b Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:27:36 +0700 Subject: [PATCH 2/4] Create fix-pre-push-hook_2023-07-20-21-26.json --- .../rush-lib/fix-pre-push-hook_2023-07-20-21-26.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@microsoft/rush-lib/fix-pre-push-hook_2023-07-20-21-26.json diff --git a/common/changes/@microsoft/rush-lib/fix-pre-push-hook_2023-07-20-21-26.json b/common/changes/@microsoft/rush-lib/fix-pre-push-hook_2023-07-20-21-26.json new file mode 100644 index 00000000000..2e82fd2dbf9 --- /dev/null +++ b/common/changes/@microsoft/rush-lib/fix-pre-push-hook_2023-07-20-21-26.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush-lib", + "comment": "Fix issue where git pre-push didn't stop push even script exit with error", + "type": "patch" + } + ], + "packageName": "@microsoft/rush-lib" +} From 1a0e02bdeedfe3e85efd1b918a4232f917c1996c Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:30:42 +0700 Subject: [PATCH 3/4] fix: invalid change path --- .../fix-pre-push-hook_2023-07-20-21-26.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename common/changes/@microsoft/{rush-lib => rush}/fix-pre-push-hook_2023-07-20-21-26.json (64%) diff --git a/common/changes/@microsoft/rush-lib/fix-pre-push-hook_2023-07-20-21-26.json b/common/changes/@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json similarity index 64% rename from common/changes/@microsoft/rush-lib/fix-pre-push-hook_2023-07-20-21-26.json rename to common/changes/@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json index 2e82fd2dbf9..f9feac49ebf 100644 --- a/common/changes/@microsoft/rush-lib/fix-pre-push-hook_2023-07-20-21-26.json +++ b/common/changes/@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json @@ -1,10 +1,10 @@ { "changes": [ { - "packageName": "@microsoft/rush-lib", + "packageName": "@microsoft/rush", "comment": "Fix issue where git pre-push didn't stop push even script exit with error", "type": "patch" } ], - "packageName": "@microsoft/rush-lib" + "packageName": "@microsoft/rush" } From 93d0bf760f4d36e8d702cfe43e1b2ce698d47cfd Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 24 Jul 2023 10:54:17 -0700 Subject: [PATCH 4/4] Rush change. --- .../@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/changes/@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json b/common/changes/@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json index f9feac49ebf..ea79c9cc045 100644 --- a/common/changes/@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json +++ b/common/changes/@microsoft/rush/fix-pre-push-hook_2023-07-20-21-26.json @@ -2,7 +2,7 @@ "changes": [ { "packageName": "@microsoft/rush", - "comment": "Fix issue where git pre-push didn't stop push even script exit with error", + "comment": "Fix an issue where the git pre-push hook would allow push to go through if the script exited with error.", "type": "patch" } ],