首页 > 解决方案 > 本地运行危险失败,没有任何信息

问题描述

我正在尝试使用以下命令在本地运行 Danger:

danger pr https://github.com/MyOwner/MyRepo/pull/219

每次,此命令都失败,没有更多信息......

Traceback (most recent call last):
    30: from /usr/local/bin/danger:23:in `<main>'
    29: from /usr/local/bin/danger:23:in `load'
    28: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/bin/danger:5:in `<top (required)>'
    27: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    26: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/commands/pr.rb:60:in `run'
    25: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/commands/pr.rb:60:in `new'
    24: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/danger_core/environment_manager.rb:30:in `initialize'
    23: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/danger_core/environment_manager.rb:30:in `new'
    22: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/ci_source/local_git_repo.rb:45:in `initialize'
    21: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/ci_source/local_git_repo.rb:95:in `found_pull_request'
    20: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/ci_source/support/pull_request_finder.rb:17:in `call'
    19: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/ci_source/support/pull_request_finder.rb:31:in `check_if_any_pull_request!'
    18: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/ci_source/support/pull_request_finder.rb:51:in `pull_request'
    17: from /Library/Ruby/Gems/2.6.0/gems/danger-8.0.4/lib/danger/ci_source/support/pull_request_finder.rb:93:in `remote_pull_request'
    16: from /Library/Ruby/Gems/2.6.0/gems/octokit-4.18.0/lib/octokit/client/pull_requests.rb:33:in `pull_request'
    15: from /Library/Ruby/Gems/2.6.0/gems/octokit-4.18.0/lib/octokit/connection.rb:19:in `get'
    14: from /Library/Ruby/Gems/2.6.0/gems/octokit-4.18.0/lib/octokit/connection.rb:156:in `request'
    13: from /Library/Ruby/Gems/2.6.0/gems/sawyer-0.8.2/lib/sawyer/agent.rb:94:in `call'
    12: from /Library/Ruby/Gems/2.6.0/gems/faraday-1.0.1/lib/faraday/connection.rb:198:in `get'
    11: from /Library/Ruby/Gems/2.6.0/gems/faraday-1.0.1/lib/faraday/connection.rb:492:in `run_request'
    10: from /Library/Ruby/Gems/2.6.0/gems/faraday-1.0.1/lib/faraday/rack_builder.rb:153:in `build_response'
     9: from /Library/Ruby/Gems/2.6.0/gems/faraday-http-cache-2.2.0/lib/faraday/http_cache.rb:115:in `call'
     8: from /Library/Ruby/Gems/2.6.0/gems/faraday-http-cache-2.2.0/lib/faraday/http_cache.rb:135:in `call!'
     7: from /Library/Ruby/Gems/2.6.0/gems/faraday-http-cache-2.2.0/lib/faraday/http_cache.rb:187:in `process'
     6: from /Library/Ruby/Gems/2.6.0/gems/faraday-http-cache-2.2.0/lib/faraday/http_cache.rb:283:in `fetch'
     5: from /Library/Ruby/Gems/2.6.0/gems/octokit-4.18.0/lib/octokit/middleware/follow_redirects.rb:61:in `call'
     4: from /Library/Ruby/Gems/2.6.0/gems/octokit-4.18.0/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
     3: from /Library/Ruby/Gems/2.6.0/gems/faraday-1.0.1/lib/faraday/response.rb:11:in `call'
     2: from /Library/Ruby/Gems/2.6.0/gems/faraday-1.0.1/lib/faraday/response.rb:65:in `on_complete'
     1: from /Library/Ruby/Gems/2.6.0/gems/faraday-1.0.1/lib/faraday/response.rb:12:in `block in call'
/Library/Ruby/Gems/2.6.0/gems/octokit-4.18.0/lib/octokit/response/raise_error.rb:16:in `on_complete': GET https://api.github.com/repos/MyOwner/MyRepo/pulls/219: 404 - Not Found // See: https://developer.github.com/v3/pulls/#get-a-single-pull-request (Octokit::NotFound)

我该怎么做才能获得有关此问题的更多信息?

标签: danger

解决方案


其中一些是猜测,但...

你得到一个 404 https://api.github.com/repos/MyOwner/MyRepo/pulls/219 我希望是因为你没有提供访问令牌。(GitHub 在未经授权的端点上抛出 404 以确保安全)

查看他们的文档:https ://danger.systems/js/guides/getting_started.html#setting-up-an-access-token


推荐阅读