From f4dcf1d1ba94fea98f2d725fd3ecd8a01b920c54 Mon Sep 17 00:00:00 2001 From: hoangdv2429 Date: Thu, 25 Apr 2024 14:18:18 +0700 Subject: [PATCH 1/3] feat(ci): add auto update changelog workflow --- .github/workflows/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 39d3ef7..970395e 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -78,4 +78,4 @@ jobs: - name: Log if PR updated if: steps.cpr.outputs.pull-request-operation == 'updated' run: | - echo "Changelog PR updated due to new commit to main." + echo "Changelog PR updated due to new commit to main." \ No newline at end of file From 1ff6bda059e8a08f20bcf177f7863f3dbe102461 Mon Sep 17 00:00:00 2001 From: hoangdv2429 Date: Fri, 17 May 2024 17:27:34 +0700 Subject: [PATCH 2/3] revert --- .github/workflows/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 970395e..39d3ef7 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -78,4 +78,4 @@ jobs: - name: Log if PR updated if: steps.cpr.outputs.pull-request-operation == 'updated' run: | - echo "Changelog PR updated due to new commit to main." \ No newline at end of file + echo "Changelog PR updated due to new commit to main." From 91c851a0710ee21979f1314eb40c3752c3864306 Mon Sep 17 00:00:00 2001 From: hoangdv2429 Date: Fri, 17 May 2024 17:30:04 +0700 Subject: [PATCH 3/3] script and hook --- .githook/pre-push | 37 +++++++++++++++++++++++++++++++++++++ README.md | 12 ++++++++++++ scripts/setup-git-hooks.sh | 9 +++++++++ 3 files changed, 58 insertions(+) create mode 100644 .githook/pre-push create mode 100644 scripts/setup-git-hooks.sh diff --git a/.githook/pre-push b/.githook/pre-push new file mode 100644 index 0000000..f003fa0 --- /dev/null +++ b/.githook/pre-push @@ -0,0 +1,37 @@ +#!/bin/sh +# pre-push hook script + +# Ensure golangci-lint is installed +if ! command -v golangci-lint >/dev/null 2>&1; then + echo "golangci-lint is not installed. Please install it with 'go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.0'" + exit 1 +fi + +# Ensure markdownlint is installed +if ! command -v markdownlint >/dev/null 2>&1; then + echo "markdownlint-cli is not installed. Please install it with 'npm install -g markdownlint-cli'" + exit 1 +fi + +# Run golangci-lint +golangci-lint run + +# Capture the exit status of golangci-lint +RESULT=$? +if [ $RESULT -ne 0 ]; then + echo "golangci-lint checks failed. Aborting push." + exit 1 +fi + +# Run markdownlint +markdownlint . --config .markdownlint.yaml + +# Capture the exit status of markdownlint +RESULT=$? +if [ $RESULT -ne 0 ]; then + echo "markdownlint checks failed. Aborting push." + exit 1 +fi + +# If all tests pass, allow the push to proceed +exit 0 diff --git a/README.md b/README.md index 91b865d..61b8daf 100644 --- a/README.md +++ b/README.md @@ -287,3 +287,15 @@ Start the rollapp: ```shell rollapp-wasm start ``` + +## Developer + +For support, join our [Discord](http://discord.gg/dymension) community and find us in the Developer section. + +### Setup push hooks + +To setup push hooks, run the following command: + +```sh +./scripts/setup_push_hooks.sh +``` \ No newline at end of file diff --git a/scripts/setup-git-hooks.sh b/scripts/setup-git-hooks.sh new file mode 100644 index 0000000..185f0fb --- /dev/null +++ b/scripts/setup-git-hooks.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Copy pre-push hook to .git/hooks/ +cp ./.githooks/pre-push ./.git/hooks/pre-push + +# Make the pre-push hook executable +chmod +x .git/hooks/pre-push + +echo "Git push hooks installed successfully."