Skip to content

Commit

Permalink
bugfix: pre-push - pre-push hook removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja - Juspay committed Nov 28, 2023
1 parent a81d313 commit 8416eea
Show file tree
Hide file tree
Showing 22 changed files with 35,752 additions and 5,552 deletions.
11 changes: 9 additions & 2 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/sh

echo "~~~~**** Commit hook started ****~~~~"

commit_msg_file=$1
commit_msg=$(cat "$commit_msg_file")


# Define your commit message convention (e.g., starts with "feat:", "fix:", etc.)
commit_regex="^(feature|bugfix|chore|docs|style|refactor|test|enhancement) .+"
# For formatting your code
npx prettier --write .
npm run re:format

# Define your commit message convention (e.g., starts with "feature:", "fix:", etc.)
commit_regex="^(feature|bugfix|chore|docs|style|refactor|test|enhancement).+"

if ! echo "$commit_msg" | grep -E "$commit_regex" ; then
echo "Aborting commit. Your commit message does not follow the conventional format."
Expand All @@ -14,4 +20,5 @@ if ! echo "$commit_msg" | grep -E "$commit_regex" ; then
fi

# If the commit message matches the convention, the script exits successfully.
echo "~~~~**** Commit hook completed ****~~~~"
exit 0
16 changes: 0 additions & 16 deletions .githooks/pre-push

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20

- name: "Setup yarn"
run: corepack enable

- name: "Install dependencies"
run: yarn install

- name: "Build"
run: npm run re:build
run: npm run re:build
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"license": "MIT",
"scripts": {
"pre-commit": "git config core.hooksPath .githooks && chmod +x .githooks/commit-msg && bash .githooks/commit-msg",
"pre-push": "git config core.hooksPath .githooks && chmod +x .githooks/pre-push && bash .githooks/pre-push",
"start": "chmod +x ./replace_env.sh && ./replace_env.sh && cp env-config.js ./public/hyperswitch && APP_VERSION=$npm_package_version && appName=hyperswitch webpack serve --config webpack.dev.js",
"start:server_compiler": "webpack --config webpack.server.js --watch",
"prod:start": "webpack serve --config webpack.dev.js",
Expand All @@ -27,8 +26,7 @@
},
"husky": {
"hooks": {
"pre-commit": "npm run pre-commit",
"pre-push": "npm run pre-push"
"pre-commit": "npm run pre-commit"
}
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 8416eea

Please sign in to comment.