Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed golangci-lint run does not cause check to fail #64

Closed
a-hat opened this issue Feb 9, 2021 · 4 comments
Closed

Failed golangci-lint run does not cause check to fail #64

a-hat opened this issue Feb 9, 2021 · 4 comments

Comments

@a-hat
Copy link

a-hat commented Feb 9, 2021

If golangci-lint fails to run for any reason, then I would like the GitHub check to end with a failure also.
Is there a way to achieve that?

Output of reviewdog:

Running golangci-lint with reviewdog 馃惗 ...
  level=error msg="Running error: buildir: analysis skipped: errors in package: [/home/runner/work/redacted.go:346:17: Broken not declared by package context]"
  2021/02/09 12:11:20 [golangci] reported: https://github.com/redacted/runs/1862870704 (conclusion=success)

Configuration:

name: reviewdog
on: [pull_request]
jobs:
    golangci-lint:
        name: runner / golangci-lint
        runs-on: ubuntu-latest
        steps:
            - name: Check out code into the Go module directory
              uses: actions/checkout@v1
            - uses: actions/setup-go@v2
              with:
                  go-version: "^1.15.7"
            - name: golangci-lint
              uses: reviewdog/action-golangci-lint@v1
              with:
                  filter_mode: nofilter
@Doarakko
Copy link
Member

@a-hat
I fixed it!
#77

Please upgrade action version to v1.21.1 and set fail_on_error to true.
https://github.com/reviewdog/action-golangci-lint#fail_on_error

@haya14busa
Copy link
Member

Thanks!

@a-hat
Copy link
Author

a-hat commented May 17, 2021

Hi @Doarakko, thanks for addressing this!

I added fail_on_error: true to my config, but still the action reports a success when golangci-lint fails.

Here is the config:

name: reviewdog
on: [pull_request]
jobs:
    golangci-lint:
        name: runner / golangci-lint
        runs-on: ubuntu-latest
        steps:
            - name: Check out code into the Go module directory
              uses: actions/checkout@v2
            - uses: actions/setup-go@v2
              with:
                  go-version: "1.16"
            - name: golangci-lint
              uses: reviewdog/action-golangci-lint@v1.21.1
              with:
                  filter_mode: nofilter
                  fail_on_error: true

Output:

Running golangci-lint with reviewdog 馃惗 ...
  level=error msg="Running error: context loading failed: failed to load packages: redacted\n"
  2021/05/17 05:58:15 [golangci] reported: https://github.com/redacted/runs/123 (conclusion=success)

Any idea what might be the issue here?

@Doarakko
Copy link
Member

@a-hat
I tried it and it worked fine.
Doarakko/reviewdog-playground#15

context loading failed: failed to load packages: redacted\

It looks like a project-dependent issue, not action-golangci-lint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants