From dcdcabbce2b2fb48157d05e0a60fde75104234fd Mon Sep 17 00:00:00 2001 From: Canzhen Zhou Date: Wed, 17 Apr 2024 22:23:53 +0000 Subject: [PATCH] feat(load-test): add pre-commit hook to convert typescript to javascript for k6 --- .github/workflows/ci.yaml | 2 +- hooks/javascript/load-test-convert-ts-to-js.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 hooks/javascript/load-test-convert-ts-to-js.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c864b97..6bdc4d7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest if: github.ref != 'refs/heads/main' steps: - - uses: open-turo/actions-release/release-notes-preview@v2 + - uses: open-turo/actions-release/lint-release-notes@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} env: diff --git a/hooks/javascript/load-test-convert-ts-to-js.sh b/hooks/javascript/load-test-convert-ts-to-js.sh new file mode 100644 index 0000000..f815235 --- /dev/null +++ b/hooks/javascript/load-test-convert-ts-to-js.sh @@ -0,0 +1,9 @@ +# This should be used by load-test only, + +currentBranch=$(git rev-parse --abbrev-ref HEAD) + +if git diff-tree --no-commit-id --name-only -r HEAD..origin/$currentBranch | grep -q 'load-test/'; then + echo 'hahahha!' + cd load-test + npm run bundle +fi