Skip to content

Action raises errors for non PR check runs #10

@dlackty

Description

@dlackty

While trying to debug #9 , I set up a sample project and found an issue that this action now only works with pull requests:

/action/lib/github_client.rb:40:in `request_http': Not Found: {"message":"Not Found","documentation_url":"https://docs.github.com/rest"} (RuntimeError)
[236](https://github.com/polydice/railsgoat/runs/6637854982?check_suite_focus=true#step:4:237)
	from /action/lib/github_client.rb:19:in `post'
[237](https://github.com/polydice/railsgoat/runs/6637854982?check_suite_focus=true#step:4:238)
	from /action/lib/github_check_run_service.rb:47:in `client_post_pull_requests'
[238](https://github.com/polydice/railsgoat/runs/6637854982?check_suite_focus=true#step:4:239)
	from /action/lib/github_check_run_service.rb:31:in `block in run'
[239](https://github.com/polydice/railsgoat/runs/6637854982?check_suite_focus=true#step:4:240)
	from /action/lib/github_check_run_service.rb:28:in `each'
[240](https://github.com/polydice/railsgoat/runs/6637854982?check_suite_focus=true#step:4:241)
	from /action/lib/github_check_run_service.rb:28:in `each_slice'
[241](https://github.com/polydice/railsgoat/runs/6637854982?check_suite_focus=true#step:4:242)
	from /action/lib/github_check_run_service.rb:28:in `run'
[242](https://github.com/polydice/railsgoat/runs/6637854982?check_suite_focus=true#step:4:243)
	from /action/lib/index.rb:34:in `<main>'

Specifically, the following code causes the issue:

https://github.com/cookpad/brakeman-linter-action/blob/v2.0.1-rc.1/lib/github_check_run_service.rb#L62-L64

Maybe we should check if this is an action run triggered by PR before calling this GitHub API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions