reviewdog / action-rubocop

Run rubocop with reviewdog 🐶
MIT License
114 stars 75 forks source link

on: push trigger support #37

Closed tonyvince closed 3 years ago

tonyvince commented 3 years ago

It seems like the action does not support push action, Is there a workaround for this?

rubocop version: 0.81.0

action

name: RuboCop
on: [push, pull_request]
jobs:
  rubocop:
    name: runner / rubocop
    runs-on: ubuntu-18.04
    steps:
      - name: Check out code
        uses: actions/checkout@v1
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.5.1
      - name: rubocop
        uses: reviewdog/action-rubocop@v1
        with:
          rubocop_version: gemfile
          rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
          github_token: ${{ secrets.GITHUB_TOKEN }}
          reporter: github-pr-review # Default is github-pr-check
          fail_on_error: true

error trace

 Running rubocop with reviewdog 🐶 ...
  reviewdog: this is not PullRequest build.
  warning: parser/current is loading parser/ruby25, which recognizes
  warning: 2.5.8-compliant syntax, but you are running 2.5.1.
  warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
  The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

  Please also note that can also opt-in to new cops by default by adding this to your config:
    AllCops:
      NewCops: enable
  Gemspec/DateAssignment: # (new in 1.10)
    Enabled: true
  Layout/SpaceBeforeBrackets: # (new in 1.7)
    Enabled: true
  Lint/AmbiguousAssignment: # (new in 1.7)
    Enabled: true
  Lint/DeprecatedConstants: # (new in 1.8)
    Enabled: true
  Lint/DuplicateBranch: # (new in 1.3)
    Enabled: true
  Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
    Enabled: true
  Lint/EmptyBlock: # (new in 1.1)
    Enabled: true
  Lint/EmptyClass: # (new in 1.3)
    Enabled: true
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
    Enabled: true
  Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
    Enabled: true
  Lint/NumberedParameterAssignment: # (new in 1.9)
    Enabled: true
  Lint/OrAssignmentToConstant: # (new in 1.9)
    Enabled: true
  Lint/RedundantDirGlobSort: # (new in 1.8)
    Enabled: true
  Lint/SymbolConversion: # (new in 1.9)
    Enabled: true
  Lint/ToEnumArguments: # (new in 1.1)
    Enabled: true
  Lint/TripleQuotes: # (new in 1.9)
    Enabled: true
  Lint/UnexpectedBlockArity: # (new in 1.5)
    Enabled: true
  Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
    Enabled: true
  Style/ArgumentsForwarding: # (new in 1.1)
    Enabled: true
  Style/CollectionCompact: # (new in 1.2)
    Enabled: true
  Style/DocumentDynamicEvalDefinition: # (new in 1.1)
    Enabled: true
  Style/EndlessMethod: # (new in 1.8)
    Enabled: true
  Style/HashConversion: # (new in 1.10)
    Enabled: true
  Style/HashExcept: # (new in 1.7)
    Enabled: true
  Style/IfWithBooleanLiteralBranches: # (new in 1.9)
    Enabled: true
  Style/NegatedIfElseCondition: # (new in 1.2)
    Enabled: true
  Style/NilLambda: # (new in 1.3)
    Enabled: true
  Style/RedundantArgument: # (new in 1.4)
    Enabled: true
  Style/SwapValues: # (new in 1.1)
    Enabled: true
  For more information: https://docs.rubocop.org/rubocop/versioning.html
  The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

  Please also note that can also opt-in to new cops by default by adding this to your config:
    AllCops:
      NewCops: enable
  Gemspec/DateAssignment: # (new in 1.10)
    Enabled: true
  Layout/SpaceBeforeBrackets: # (new in 1.7)
    Enabled: true
  Lint/AmbiguousAssignment: # (new in 1.7)
    Enabled: true
  Lint/DeprecatedConstants: # (new in 1.8)
    Enabled: true
  Lint/DuplicateBranch: # (new in 1.3)
    Enabled: true
  Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
    Enabled: true
  Lint/EmptyBlock: # (new in 1.1)
    Enabled: true
  Lint/EmptyClass: # (new in 1.3)
    Enabled: true
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
    Enabled: true
  Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
    Enabled: true
  Lint/NumberedParameterAssignment: # (new in 1.9)
    Enabled: true
  Lint/OrAssignmentToConstant: # (new in 1.9)
    Enabled: true
  Lint/RedundantDirGlobSort: # (new in 1.8)
    Enabled: true
  Lint/SymbolConversion: # (new in 1.9)
    Enabled: true
  Lint/ToEnumArguments: # (new in 1.1)
    Enabled: true
  Lint/TripleQuotes: # (new in 1.9)
    Enabled: true
  Lint/UnexpectedBlockArity: # (new in 1.5)
    Enabled: true
  Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
    Enabled: true
  Style/ArgumentsForwarding: # (new in 1.1)
    Enabled: true
  Style/CollectionCompact: # (new in 1.2)
    Enabled: true
  Style/DocumentDynamicEvalDefinition: # (new in 1.1)
    Enabled: true
  Style/EndlessMethod: # (new in 1.8)
    Enabled: true
  Style/HashConversion: # (new in 1.10)
    Enabled: true
  Style/HashExcept: # (new in 1.7)
    Enabled: true
  Style/IfWithBooleanLiteralBranches: # (new in 1.9)
    Enabled: true
  Style/NegatedIfElseCondition: # (new in 1.2)
    Enabled: true
  Style/NilLambda: # (new in 1.3)
    Enabled: true
  Style/RedundantArgument: # (new in 1.4)
    Enabled: true
  Style/SwapValues: # (new in 1.1)
    Enabled: true
  For more information: https://docs.rubocop.org/rubocop/versioning.html
  The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

  Please also note that can also opt-in to new cops by default by adding this to your config:
    AllCops:
      NewCops: enable
  Gemspec/DateAssignment: # (new in 1.10)
    Enabled: true
  Layout/SpaceBeforeBrackets: # (new in 1.7)
    Enabled: true
  Lint/AmbiguousAssignment: # (new in 1.7)
    Enabled: true
  Lint/DeprecatedConstants: # (new in 1.8)
    Enabled: true
  Lint/DuplicateBranch: # (new in 1.3)
    Enabled: true
  Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
    Enabled: true
  Lint/EmptyBlock: # (new in 1.1)
    Enabled: true
  Lint/EmptyClass: # (new in 1.3)
    Enabled: true
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
    Enabled: true
  Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
    Enabled: true
  Lint/NumberedParameterAssignment: # (new in 1.9)
    Enabled: true
  Lint/OrAssignmentToConstant: # (new in 1.9)
    Enabled: true
  Lint/RedundantDirGlobSort: # (new in 1.8)
    Enabled: true
  Lint/SymbolConversion: # (new in 1.9)
    Enabled: true
  Lint/ToEnumArguments: # (new in 1.1)
    Enabled: true
  Lint/TripleQuotes: # (new in 1.9)
    Enabled: true
  Lint/UnexpectedBlockArity: # (new in 1.5)
    Enabled: true
  Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
    Enabled: true
  Style/ArgumentsForwarding: # (new in 1.1)
    Enabled: true
  Style/CollectionCompact: # (new in 1.2)
    Enabled: true
  Style/DocumentDynamicEvalDefinition: # (new in 1.1)
    Enabled: true
  Style/EndlessMethod: # (new in 1.8)
    Enabled: true
  Style/HashConversion: # (new in 1.10)
    Enabled: true
  Style/HashExcept: # (new in 1.7)
    Enabled: true
  Style/IfWithBooleanLiteralBranches: # (new in 1.9)
    Enabled: true
  Style/NegatedIfElseCondition: # (new in 1.2)
    Enabled: true
  Style/NilLambda: # (new in 1.3)
    Enabled: true
  Style/RedundantArgument: # (new in 1.4)
    Enabled: true
  Style/SwapValues: # (new in 1.1)
    Enabled: true
  For more information: https://docs.rubocop.org/rubocop/versioning.html
  The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

  Please also note that can also opt-in to new cops by default by adding this to your config:
    AllCops:
      NewCops: enable
  Gemspec/DateAssignment: # (new in 1.10)
    Enabled: true
  Layout/SpaceBeforeBrackets: # (new in 1.7)
    Enabled: true
  Lint/AmbiguousAssignment: # (new in 1.7)
    Enabled: true
  Lint/DeprecatedConstants: # (new in 1.8)
    Enabled: true
  Lint/DuplicateBranch: # (new in 1.3)
    Enabled: true
  Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
    Enabled: true
  Lint/EmptyBlock: # (new in 1.1)
    Enabled: true
  Lint/EmptyClass: # (new in 1.3)
    Enabled: true
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
    Enabled: true
  Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
    Enabled: true
  Lint/NumberedParameterAssignment: # (new in 1.9)
    Enabled: true
  Lint/OrAssignmentToConstant: # (new in 1.9)
    Enabled: true
  Lint/RedundantDirGlobSort: # (new in 1.8)
    Enabled: true
  Lint/SymbolConversion: # (new in 1.9)
    Enabled: true
  Lint/ToEnumArguments: # (new in 1.1)
    Enabled: true
  Lint/TripleQuotes: # (new in 1.9)
    Enabled: true
  Lint/UnexpectedBlockArity: # (new in 1.5)
    Enabled: true
  Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
    Enabled: true
  Style/ArgumentsForwarding: # (new in 1.1)
    Enabled: true
  Style/CollectionCompact: # (new in 1.2)
    Enabled: true
  Style/DocumentDynamicEvalDefinition: # (new in 1.1)
    Enabled: true
  Style/EndlessMethod: # (new in 1.8)
    Enabled: true
  Style/HashConversion: # (new in 1.10)
    Enabled: true
  Style/HashExcept: # (new in 1.7)
    Enabled: true
  Style/IfWithBooleanLiteralBranches: # (new in 1.9)
    Enabled: true
  Style/NegatedIfElseCondition: # (new in 1.2)
    Enabled: true
  Style/NilLambda: # (new in 1.3)
    Enabled: true
  Style/RedundantArgument: # (new in 1.4)
    Enabled: true
  Style/SwapValues: # (new in 1.1)
    Enabled: true
  For more information: https://docs.rubocop.org/rubocop/versioning.html
  The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

  Please also note that can also opt-in to new cops by default by adding this to your config:
    AllCops:
      NewCops: enable
  Gemspec/DateAssignment: # (new in 1.10)
    Enabled: true
  Layout/SpaceBeforeBrackets: # (new in 1.7)
    Enabled: true
  Lint/AmbiguousAssignment: # (new in 1.7)
    Enabled: true
  Lint/DeprecatedConstants: # (new in 1.8)
    Enabled: true
  Lint/DuplicateBranch: # (new in 1.3)
    Enabled: true
  Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
    Enabled: true
  Lint/EmptyBlock: # (new in 1.1)
    Enabled: true
  Lint/EmptyClass: # (new in 1.3)
    Enabled: true
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
    Enabled: true
  Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
    Enabled: true
  Lint/NumberedParameterAssignment: # (new in 1.9)
    Enabled: true
  Lint/OrAssignmentToConstant: # (new in 1.9)
    Enabled: true
  Lint/RedundantDirGlobSort: # (new in 1.8)
    Enabled: true
  Lint/SymbolConversion: # (new in 1.9)
    Enabled: true
  Lint/ToEnumArguments: # (new in 1.1)
    Enabled: true
  Lint/TripleQuotes: # (new in 1.9)
    Enabled: true
  Lint/UnexpectedBlockArity: # (new in 1.5)
    Enabled: true
  Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
    Enabled: true
  Style/ArgumentsForwarding: # (new in 1.1)
    Enabled: true
  Style/CollectionCompact: # (new in 1.2)
    Enabled: true
  Style/DocumentDynamicEvalDefinition: # (new in 1.1)
    Enabled: true
  Style/EndlessMethod: # (new in 1.8)
    Enabled: true
  Style/HashConversion: # (new in 1.10)
    Enabled: true
  Style/HashExcept: # (new in 1.7)
    Enabled: true
  Style/IfWithBooleanLiteralBranches: # (new in 1.9)
    Enabled: true
  Style/NegatedIfElseCondition: # (new in 1.2)
    Enabled: true
  Style/NilLambda: # (new in 1.3)
    Enabled: true
  Style/RedundantArgument: # (new in 1.4)
    Enabled: true
  Style/SwapValues: # (new in 1.1)
    Enabled: true
  For more information: https://docs.rubocop.org/rubocop/versioning.html
  The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

  Please also note that can also opt-in to new cops by default by adding this to your config:
    AllCops:
      NewCops: enable
  Gemspec/DateAssignment: # (new in 1.10)
    Enabled: true
  Layout/SpaceBeforeBrackets: # (new in 1.7)
    Enabled: true
  Lint/AmbiguousAssignment: # (new in 1.7)
    Enabled: true
  Lint/DeprecatedConstants: # (new in 1.8)
    Enabled: true
  Lint/DuplicateBranch: # (new in 1.3)
    Enabled: true
  Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
    Enabled: true
  Lint/EmptyBlock: # (new in 1.1)
    Enabled: true
  Lint/EmptyClass: # (new in 1.3)
    Enabled: true
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
    Enabled: true
  Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
    Enabled: true
  Lint/NumberedParameterAssignment: # (new in 1.9)
    Enabled: true
  Lint/OrAssignmentToConstant: # (new in 1.9)
    Enabled: true
  Lint/RedundantDirGlobSort: # (new in 1.8)
    Enabled: true
  Lint/SymbolConversion: # (new in 1.9)
    Enabled: true
  Lint/ToEnumArguments: # (new in 1.1)
    Enabled: true
  Lint/TripleQuotes: # (new in 1.9)
    Enabled: true
  Lint/UnexpectedBlockArity: # (new in 1.5)
    Enabled: true
  Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
    Enabled: true
  Style/ArgumentsForwarding: # (new in 1.1)
    Enabled: true
  Style/CollectionCompact: # (new in 1.2)
    Enabled: true
  Style/DocumentDynamicEvalDefinition: # (new in 1.1)
    Enabled: true
  Style/EndlessMethod: # (new in 1.8)
    Enabled: true
  Style/HashConversion: # (new in 1.10)
    Enabled: true
  Style/HashExcept: # (new in 1.7)
    Enabled: true
  Style/IfWithBooleanLiteralBranches: # (new in 1.9)
    Enabled: true
  Style/NegatedIfElseCondition: # (new in 1.2)
    Enabled: true
  Style/NilLambda: # (new in 1.3)
    Enabled: true
  Style/RedundantArgument: # (new in 1.4)
    Enabled: true
  Style/SwapValues: # (new in 1.1)
    Enabled: true
  For more information: https://docs.rubocop.org/rubocop/versioning.html
  Broken pipe @ io_write - <STDOUT>
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/clang_style_formatter.rb:18:in `write'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/clang_style_formatter.rb:18:in `printf'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/clang_style_formatter.rb:18:in `report_offense'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/clang_style_formatter.rb:12:in `block in report_file'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/clang_style_formatter.rb:12:in `each'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/clang_style_formatter.rb:12:in `report_file'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/progress_formatter.rb:42:in `block in finished'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/progress_formatter.rb:41:in `each'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/progress_formatter.rb:41:in `finished'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/formatter_set.rb:34:in `public_send'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/formatter_set.rb:34:in `block (3 levels) in <class:FormatterSet>'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/formatter_set.rb:34:in `each'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/formatter/formatter_set.rb:34:in `block (2 levels) in <class:FormatterSet>'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/runner.rb:95:in `ensure in inspect_files'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/runner.rb:96:in `inspect_files'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/runner.rb:47:in `run'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli/command.rb:11:in `run'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli/environment.rb:18:in `run'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli.rb:65:in `run_command'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli.rb:72:in `execute_runners'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/lib/rubocop/cli.rb:41:in `run'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/exe/rubocop:13:in `block in <top (required)>'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/lib/ruby/gems/2.5.0/gems/rubocop-1.11.0/exe/rubocop:12:in `<top (required)>'
  /opt/hostedtoolcache/Ruby/2.5.1/x64/bin/rubocop:23:in `load'
mgrachev commented 3 years ago

@tonyvince Hey 👋 Thank you for your feedback!

I guess, reviewdog only works with Pull Requests, because I see the following message:

reviewdog: this is not PullRequest build.

@haya14busa Please correct me If I'm wrong

mgrachev commented 3 years ago

@tonyvince Try to use the github-check reporter instead of the github-pr-review:

name: RuboCop
on: [push, pull_request]
jobs:
  rubocop:
    name: runner / rubocop
    runs-on: ubuntu-18.04
    steps:
      - name: Check out code
        uses: actions/checkout@v1
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.5.1
      - name: rubocop
        uses: reviewdog/action-rubocop@v1
        with:
          rubocop_version: gemfile
          rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
          github_token: ${{ secrets.GITHUB_TOKEN }}
          reporter: github-check
          fail_on_error: true
mgrachev commented 3 years ago

@tonyvince Can I close this issue?

NickLarsenNZ commented 2 years ago

Shouldn't github-check be documented as a valid option?

I'm trying to run this on workflow_dispatch and get the following error:

reviewdog: post failed for rubocop: failed to create check: POST https://api.github.com/repos/org/repo/check-runs: 422 No commit found for SHA:  []

I imagine this is because github-check assumes the SHA from a push. I'm unsure what is different about where the SHA comes from, but I see it can be set with CI_COMMIT:

https://github.com/reviewdog/reviewdog/blob/9af78a848bb9fbaab9627b2aa88c6dbd21c3815f/cmd/reviewdog/main.go#L180-L183

In my case, I plan to do something like:

    - name: Set commit SHA for non pr runs
      if: github.event_name != 'pull_request'
      run: echo ::set-env name=CI_COMMIT::${{ github.sha }}

    - name: rubocop_rails
      uses: reviewdog/action-rubocop@v2
      with:
        rubocop_version: gemfile
        rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
        github_token: ${{ secrets.github_token }}
        level: ${{ github.event.inputs.rubocop_log_level != '' && github.event.inputs.rubocop_log_level || 'error' }}
        workdir: rails/
        fail_on_error: false # for now
        reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }}
NickLarsenNZ commented 2 years ago

The above didn't work for me because there is a separate code path for github actions: https://github.com/reviewdog/reviewdog/blob/8c93ceaf90b675262a5386828501ba2b5a461df0/cienv/cienv.go#L38-L40

Which specifically looks for PullRequest information in the event object: https://github.com/reviewdog/reviewdog/blob/8c93ceaf90b675262a5386828501ba2b5a461df0/cienv/github_actions.go#L86

I've raised reviewdog/reviewdog#1062