From aabeaa8ef5b2bbb6e13d8c90da8d59607b151c6e Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:42:30 +0800 Subject: [PATCH 01/10] Update CI.yml --- .github/workflows/CI.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b4de1f3..7136fdf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,11 +14,19 @@ jobs: uses: actions/setup-go@master with: go-version: 1.20.4 + + - name: Clone libcoraza-nginx repository + uses: actions/checkout@v2 + with: + repository: potats0/coraza + path: libcoraza + ref: refs/heads/release - name: Build and Install run: | cd coraza - ./build.sh configure + ./build.sh + ./configure make sudo make install From 7cc0258a4e7801eb1572a06cdbc546f1a4069a68 Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:45:09 +0800 Subject: [PATCH 02/10] Update CI.yml --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7136fdf..06607a0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,11 +20,11 @@ jobs: with: repository: potats0/coraza path: libcoraza - ref: refs/heads/release + ref: master - name: Build and Install run: | - cd coraza + cd libcoraza ./build.sh ./configure make From d34b2214f56ad1d1bf4e9532108005943c7031be Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:46:50 +0800 Subject: [PATCH 03/10] Update CI.yml --- .github/workflows/CI.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 06607a0..291b6af 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,7 +20,6 @@ jobs: with: repository: potats0/coraza path: libcoraza - ref: master - name: Build and Install run: | From 2bac155859549b0f64ea7f90bc099c79a82aa664 Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:57:23 +0800 Subject: [PATCH 04/10] Update CI.yml --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 291b6af..0e11cb9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -35,4 +35,4 @@ jobs: openrestyVersion: "1.21.4.1" - name: run test::Nginx - run: resty -e 'print("hi from lua")' + run: prove -t From b5342c46a192b08b33704a2c08f9bdd0d646f1c8 Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:01:15 +0800 Subject: [PATCH 05/10] Update CI.yml --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0e11cb9..9988d75 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,13 +21,15 @@ jobs: repository: potats0/coraza path: libcoraza - - name: Build and Install + - name: Install build dependencies run: | cd libcoraza ./build.sh ./configure make sudo make install + cpan Test::Nginx + cpan Test::Nginx::Socket - name: Setup openresty uses: leafo/gh-actions-openresty@v1 From 010511a9dc4adcb8b5ce3d78f3d6fcc5a98b2fe0 Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:03:20 +0800 Subject: [PATCH 06/10] Update CI.yml --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9988d75..d61834f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,8 +28,8 @@ jobs: ./configure make sudo make install - cpan Test::Nginx - cpan Test::Nginx::Socket + sudo cpan Test::Nginx + sudo cpan Test::Nginx::Socket - name: Setup openresty uses: leafo/gh-actions-openresty@v1 From 0f47bf6d30398e23aca0904f9937937e732ec79b Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:18:57 +0800 Subject: [PATCH 07/10] Update CI.yml --- .github/workflows/CI.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d61834f..72edef4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,8 +28,8 @@ jobs: ./configure make sudo make install - sudo cpan Test::Nginx - sudo cpan Test::Nginx::Socket + sudo cpan -T Test::Nginx + sudo cpan -T Test::Nginx::Socket - name: Setup openresty uses: leafo/gh-actions-openresty@v1 @@ -37,4 +37,7 @@ jobs: openrestyVersion: "1.21.4.1" - name: run test::Nginx - run: prove -t + run: | + whereis openresty + export PATH=/usr/local/openresty/bin:$PATH + prove -t From 728398ac868c75bf5d1440b44fed46cc2a08e474 Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:24:03 +0800 Subject: [PATCH 08/10] Update CI.yml --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 72edef4..42659b2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -38,6 +38,6 @@ jobs: - name: run test::Nginx run: | - whereis openresty - export PATH=/usr/local/openresty/bin:$PATH - prove -t + export PATH=/usr/local/openresty/nginx/sbin:$PATH + openresty -v + sudo prove -t From a2667a2df5064e3f246be7fd15c0aaa55e590bbc Mon Sep 17 00:00:00 2001 From: potats0 <42128471+potats0@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:26:52 +0800 Subject: [PATCH 09/10] Update CI.yml --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 42659b2..385c6d8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -40,4 +40,4 @@ jobs: run: | export PATH=/usr/local/openresty/nginx/sbin:$PATH openresty -v - sudo prove -t + prove -t From e9c0e19c83d1ec78804664956ab6e50f7a0bd2c3 Mon Sep 17 00:00:00 2001 From: potatso Date: Fri, 7 Jul 2023 13:53:20 +0800 Subject: [PATCH 10/10] feat: add Lint PR --- .github/semantic-pull-request.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/semantic-pull-request.yml diff --git a/.github/semantic-pull-request.yml b/.github/semantic-pull-request.yml new file mode 100644 index 0000000..5f20ad7 --- /dev/null +++ b/.github/semantic-pull-request.yml @@ -0,0 +1,30 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed. + # Default: https://github.com/commitizen/conventional-commit-types + types: | + bugfix # bug fixes + change # backward incompatible changes + doc # documentation changes including code comments + editor # code editor related configurations + feature # implementing a new feature + optimize # performance optimizations + refactor # code refactoring and other code rearrangement + style # coding style changes + tests # test suite changes \ No newline at end of file