From d5bfeed6bb761e5cebea6cec083aea4174fd8a28 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Thu, 3 Dec 2026 09:17:41 +0700 Subject: [PATCH 1/2] ci: move lint job to reusable golangci-lint workflow Replace lint-test.yml with a lint job in build_test.yaml that calls golangci-lint.yaml, the reusable workflow in projectdiscovery/workflows. On pull requests it reports only issues on lines the pull request changes, so a pull request no longer fails on issues it didn't add, such as ones a new golangci-lint release starts reporting. Push and manual runs lint the whole module. The build job now needs lint and doesn't run when lint fails. Rename build_test.yaml to tests.yml and the workflow from Build Test to Tests, matching dsl's lint and test workflow. Point the README badge at tests.yml. tests.yml now also runs on push to main. A cache saved by a pull_request run is visible only to that pull request, so the Go and golangci-lint caches never carried over from one pull request to the next. A push run saves them on main, where every pull request can restore them. Pull requests and pushes now run it only when they change a .go or .mod file; before, every pull request ran lint and the build job. The lint timeout goes from 5m to the workflow's default of 30m. Closes: #576 Signed-off-by: Dwi Siswanto --- .github/workflows/lint-test.yml | 22 ------------------- .../workflows/{build_test.yaml => tests.yml} | 19 +++++++++++++++- README.md | 2 +- 3 files changed, 19 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/lint-test.yml rename .github/workflows/{build_test.yaml => tests.yml} (59%) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml deleted file mode 100644 index fea8ba6..0000000 --- a/.github/workflows/lint-test.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 🙏🏻 Lint Test -on: - pull_request: - workflow_dispatch: - -jobs: - lint: - name: Lint Test - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v7 - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version-file: go.mod - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v9 - with: - version: latest - args: --timeout 5m - working-directory: . diff --git a/.github/workflows/build_test.yaml b/.github/workflows/tests.yml similarity index 59% rename from .github/workflows/build_test.yaml rename to .github/workflows/tests.yml index beb2a1a..a0803fa 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/tests.yml @@ -1,13 +1,30 @@ -name: 🔨 Build Test +name: 🔨 Tests on: pull_request: + paths: + - '**.go' + - '**.mod' + push: + branches: + - main + paths: + - '**.go' + - '**.mod' workflow_dispatch: jobs: + lint: + name: Lint Test + uses: projectdiscovery/workflows/.github/workflows/golangci-lint.yaml@v1 + permissions: + contents: read + pull-requests: read + build: name: Test Builds + needs: [lint] runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/README.md b/README.md index 82f0970..1550009 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![License](https://img.shields.io/github/license/projectdiscovery/rawhttp)](LICENSE.md) ![Go version](https://img.shields.io/github/go-mod/go-version/projectdiscovery/rawhttp?filename=go.mod) [![Release](https://img.shields.io/github/release/projectdiscovery/rawhttp)](https://github.com/projectdiscovery/rawhttp/releases/) -[![Checks](https://github.com/projectdiscovery/rawhttp/actions/workflows/build_test.yaml/badge.svg)](https://github.com/projectdiscovery/rawhttp/actions/workflows/build_test.yaml) +[![Checks](https://github.com/projectdiscovery/rawhttp/actions/workflows/tests.yml/badge.svg)](https://github.com/projectdiscovery/rawhttp/actions/workflows/tests.yml) [![GoDoc](https://img.shields.io/badge/go-reference-blue)](https://pkg.go.dev/github.com/projectdiscovery/rawhttp) rawhttp is a Go package for making HTTP requests in a raw way. From 0cdc88df08c0640a15ff72733e7f89ff96ce81d9 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Thu, 3 Dec 2026 17:21:20 +0700 Subject: [PATCH 2/2] ci: run tests when tests.yml changes The paths filters matched only Go and module files, so a change to the workflow itself, including this pull request, never ran it. Add tests.yml to both lists. Refs: #576 Signed-off-by: Dwi Siswanto --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0803fa..f19530e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,12 +5,14 @@ on: paths: - '**.go' - '**.mod' + - '.github/workflows/tests.yml' push: branches: - main paths: - '**.go' - '**.mod' + - '.github/workflows/tests.yml' workflow_dispatch: