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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action pass even with warning #41

Closed
syrm opened this issue Mar 7, 2021 · 12 comments
Closed

Action pass even with warning #41

syrm opened this issue Mar 7, 2021 · 12 comments

Comments

@syrm
Copy link

syrm commented Mar 7, 2021

Hello,

With this config :

name: Lint
on:
  - pull_request
jobs:
  lint:
    name: check
    runs-on: ubuntu-latest
    steps:

      - name: Check out code into the Go module directory
        uses: actions/checkout@v2

      - name: Run Revive Action by pulling pre-built image
        uses: docker://morphy/revive-action:v1.4.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I got this ouptut :

Run docker://morphy/revive-action:v1.4.0
/usr/bin/docker run --name morphyreviveactionv140_1cc8eb --label 5588e4 --workdir /github/workspace --rm -e GITHUB_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/lerobot/lerobot":"/github/workspace" morphy/revive-action:v1.4.0
Successful run with 1 failures (1 warnings, 0 errors)

No annotation in my Pull Request, and linter result is green.

@syrm
Copy link
Author

syrm commented Mar 12, 2021

Are you ok to check this ?

@morphy2k
Copy link
Owner

That the action passes with only warnings is intentional. If you want it to fail, you have to define the rules as error.

The thing with the missing annotations I will investigate. Do you have a PR I can check out?

@syrm
Copy link
Author

syrm commented Mar 14, 2021

Hello, i found the problem.
With this it works

on:
  - push

With this it don't

on:
  - pull_request

@morphy2k
Copy link
Owner

@syrm So we can close this issue?

@syrm
Copy link
Author

syrm commented Mar 29, 2021

Well i think it should work on pull request too

@morphy2k
Copy link
Owner

Hey @syrm, could you test the upcoming new major release? I think both of your issues should be fixed with it.
https://github.com/morphy2k/revive-action/tree/v2#usage

@syrm
Copy link
Author

syrm commented Apr 18, 2021

I think its dont work.
I got this error :

Check failure on line 84 in src/collector/main.go

GitHub Actions
/ check

src/collector/main.go#L84

var testId should be testID

I see it in files, the error is annoted.
But the check pass.

@morphy2k
Copy link
Owner

So the on: pull_request issue is fixed, but the check does not fail as expected?
Warnings do not fail unless otherwise specified. This is the default behavior of Revive.

@morphy2k
Copy link
Owner

morphy2k commented Apr 18, 2021

If you want warnings to cause the check to fail, you must create a custom configuration file and specify an exit code >0 for warnings there. E.g. warningCode = 1

@syrm
Copy link
Author

syrm commented Apr 18, 2021

Yes on: pull_request issue is fixed
With warningCode = 1 too.
But why annoted code is only visible in Files changed and not in Conversation ?

@morphy2k
Copy link
Owner

This is a limitation of the GH annotations, they are only displayed in diffs.

@syrm
Copy link
Author

syrm commented Apr 18, 2021

Ok ty for your new version, nice job

@syrm syrm closed this as completed Apr 18, 2021
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

2 participants