From 40e24c7510677c5b0f07c09ac8d2b7cef1514415 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Thu, 3 Dec 2026 09:17:40 +0700 Subject: [PATCH] ci: move lint job to reusable golangci-lint workflow Replace the lint job in build-test.yml with a call to 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 job no longer skips bot pull requests, so the build job, which needs it, runs for Dependabot pull requests again. Rename build-test.yml to tests.yml and the workflow from Build Test to Tests, matching dsl's lint and test workflow. 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. The build job runs on those pushes too. Closes: #52 Signed-off-by: Dwi Siswanto --- .github/workflows/{build-test.yml => tests.yml} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename .github/workflows/{build-test.yml => tests.yml} (67%) diff --git a/.github/workflows/build-test.yml b/.github/workflows/tests.yml similarity index 67% rename from .github/workflows/build-test.yml rename to .github/workflows/tests.yml index 622600f..2e07f2f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/tests.yml @@ -1,18 +1,19 @@ -name: 🔨 Build Test +name: 🔨 Tests on: pull_request: + push: + branches: + - main workflow_dispatch: jobs: lint: name: "Lint" - if: "${{ !endsWith(github.actor, '[bot]') }}" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: projectdiscovery/actions/setup/go@v1 - - uses: projectdiscovery/actions/golangci-lint/v2@v1 + uses: projectdiscovery/workflows/.github/workflows/golangci-lint.yaml@v1 + permissions: + contents: read + pull-requests: read build: name: Test Builds