From 5c227896244afc7485c6f24a0cf341e0b5ab896b Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Mon, 16 Mar 2026 00:36:20 +0100 Subject: [PATCH] Add reviewdog to post lint errors as PR comments Use reviewdog in the CI lint job so golangci-lint and eslint failures appear as inline comments on pull request files instead of only in job logs. Signed-off-by: Bryan Frimin --- .github/workflows/make.yaml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/make.yaml b/.github/workflows/make.yaml index 44a7f319d..271fad117 100644 --- a/.github/workflows/make.yaml +++ b/.github/workflows/make.yaml @@ -125,6 +125,8 @@ jobs: runs-on: "ubuntu-22.04" permissions: contents: "read" + pull-requests: "write" + checks: "write" steps: - uses: "actions/checkout@v6" with: @@ -140,13 +142,37 @@ jobs: - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 with: install-only: true + - uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 - run: "npm i -g npm@11.8.0" - run: "npm ci" - uses: "actions/download-artifact@v6" with: name: "build-artifacts" - run: "chmod +x bin/probod" - - run: "make lint" + - name: "Run go vet" + run: "go vet ./..." + - name: "Run golangci-lint" + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + golangci-lint run --out-format=line-number ./... 2>&1 | \ + reviewdog -f=golangci-lint -reporter=github-pr-review -filter-mode=nofilter -fail-level=error -name="golangci-lint" + else + golangci-lint run ./... + fi + - name: "Run eslint" + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + for dir in apps/console apps/trust packages/ui packages/eslint-config packages/n8n-node; do + (cd "$dir" && npx eslint . --concurrency 4 --format stylish 2>/dev/null) | \ + reviewdog -f=eslint -reporter=github-pr-review -filter-mode=nofilter -fail-level=error -name="eslint ($dir)" + done + else + npm run lint + fi test: name: "test"