From 2c30719bf330b823cd9274aa61270e6cb9717943 Mon Sep 17 00:00:00 2001 From: Mohammadreza Varasteh <58051486+The-Daishogun@users.noreply.github.com> Date: Mon, 8 May 2023 19:58:48 +0330 Subject: [PATCH] skip commiting if remote is github (#2) --- scripts/post-commit.sh | 4 ++++ scripts/pre-push.sh | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/scripts/post-commit.sh b/scripts/post-commit.sh index 4db22b6..f7e4b7c 100644 --- a/scripts/post-commit.sh +++ b/scripts/post-commit.sh @@ -1,5 +1,9 @@ #!/bin/bash +if [[ $(git config --get remote.origin.url) == *"github"* ]]; then + echo "skipping sync commit since remote is github." + exit 0 +fi commit_message=$(git log -n 1 HEAD --pretty=format:%s) branch_name=$(git branch --show-current) repo_name=$(basename -s .git `git config --get remote.origin.url`) diff --git a/scripts/pre-push.sh b/scripts/pre-push.sh index 4bfc363..89089c5 100644 --- a/scripts/pre-push.sh +++ b/scripts/pre-push.sh @@ -1,5 +1,10 @@ #!/bin/bash +if [[ $(git config --get remote.origin.url) == *"github"* ]]; then + echo "skipping sync commit push since remote is github." + exit 0 +fi + syncommit push exit 0 \ No newline at end of file