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

Issue with comments not being created/posted with Github action workflow #443

Closed
ravibhusal opened this issue Apr 6, 2023 · 1 comment
Closed

Comments

@ravibhusal
Copy link

ravibhusal commented Apr 6, 2023

The following is my pronto setup

.github/workflows/pronto.yml

# https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions

name: Pronto

# Doc[Events] https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
  pull_request_target:
    types: [opened, edited, reopened]

jobs:
  pronto:

    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/[email protected]
      - name: Setup Ruby # https://github.com/ruby/setup-ruby
        uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
      - name: Setup pronto # https://github.com/prontolabs/pronto#github-integration
        run: gem install pronto pronto-rubocop rubocop-rspec rubocop-performance rubocop-rails pronto-flay pronto-reek pronto-fasterer pronto-rails_best_practices pronto-brakeman
      - name: Run Pronto
        run: bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
        env:
          PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
          PRONTO_GITHUB_ACCESS_TOKEN: ${{ github.token }}

.pronto.yml

# https://github.com/prontolabs/pronto#configuration

max_warnings: 200 #Default: 150
warnings_per_review: 100 # Default: 30
verbose: true # Default: false

Gemfile

group :development do
  gem 'pronto'
  gem 'pronto-brakeman', require: false
  gem 'pronto-fasterer', require: false
  gem 'pronto-flay', require: false
  gem 'pronto-rails_best_practices', require: false
  gem 'pronto-reek', require: false
  gem 'pronto-rubocop', require: false
end

Running pronto via github actions doesn't seem to create comment or post anything.
Logs from github action

image

However, running
PRONTO_GITHUB_ACCESS_TOKEN=xxxxx pronto run -f github_status github_pr -c origin/staging works just fine and it posts 4 messages for the same PR.

Logs: from the command line

Creating comment status on ded429c19cb90dedca60948a9ef578775d6c1f26
Creating comment status on ded429c19cb90dedca60948a9ef578775d6c1f26
Creating comment status on ded429c19cb90dedca60948a9ef578775d6c1f26
Creating comment status on ded429c19cb90dedca60948a9ef578775d6c1f26
Creating comment status on ded429c19cb90dedca60948a9ef578775d6c1f26
Creating comment status on ded429c19cb90dedca60948a9ef578775d6c1f26
Pronto::Brakeman
Pronto::Fasterer
Pronto::Flay
Pronto::RailsBestPractices
Pronto::Reek
Pronto::Rubocop
Creating a comment from message: #<Pronto::Message:0x00000001200ec0b0.....>
Creating a comment from message: #<Pronto::Message:0x00000001177f06f8.......>
Creating a comment from message: #<Pronto::Message:0x00000001177e2378......>
Creating a comment from message: #<Pronto::Message:0x00000001177dbbe0......>
Creating pull request comment on 2214
Creating pull request comment on 2214
Creating pull request comment on 2214
Creating pull request comment on 2214
4 Pronto messages posted to GitHub (0 existing)

I went through GitHub Actions Integration wiki page but couldn't find anything relevant to my issue.

@ravibhusal
Copy link
Author

Changing

on:
  pull_request_target:
    types: [opened, edited, reopened]

to

on: [pull_request]

worked for some reason.

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

1 participant