Trouble with GitHubPullRequest notification

Nicolas Ojeda Bar's Avatar

Nicolas Ojeda Bar

12 Apr, 2017 09:41 PM

Hello,

I am trying to use GitHubPullRequest notifications to post back some updates to Github. I am seeing this error in the AppVeyor log screen:

  Error sending GitHubPullRequest notification: Error commenting on GitHub pull request: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}

Am I understanding correctly that this means that Github did not understand the AppVeyor HTTP request ? How do I fix it ?

Thanks!

  1. Support Staff 1 Posted by Ilya Finkelshte... on 12 Apr, 2017 10:29 PM

    Ilya Finkelshteyn's Avatar

    Hi Nicholas,

    Please elaborate what GitHub API are you trying to call and how. You build configuration in YAML format will be helpful too.
    Also clarify if you can do the same successfully from your local computer.

    Ilya.

  2. 2 Posted by Nicolas Ojeda B... on 13 Apr, 2017 08:02 AM

    Nicolas Ojeda Bar's Avatar

    Hi Ilya,

    I am trying to use https://www.appveyor.com/docs/notifications/#github-pull-request. Here is the relevant part of my appeyor.yml:

    notifications:
      - provider: GitHubPullRequest
        auth_token:
          secure: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        template: |
          {{#passed}}
          :white_check_mark: All check passed. [Build {{buildVersion}}]
          {{/passed}}
          {{#failed}}
          :x:Some checks failed. [Build {{buildVersion}}]
          {{#jobs}}
          {{#messages}}
    
          ### {{message}}
    
          ```
          {{details}}
          ```
          {{/messages}}
          {{/jobs}}
          {{/failed}}
    

    In my build script I use appveyor command-line utility to add mesages:

    appveyor AddMessage "ERROR" -Category Error -Details "XXXX"
    

    The messages show correctly on the AppVeyor build console (in the way shown in https://www.appveyor.com/docs/build-worker-api/#add-message).

    Thanks!
    Nicolas

  3. Support Staff 3 Posted by Ilya Finkelshte... on 14 Apr, 2017 12:01 AM

    Ilya Finkelshteyn's Avatar

    Ah, I see, sorry for misunderstanding. GitHub returns 404 when access is denied. Please ensure that account from which you use token, has access to the repository with PR.
    Another possible issue is double encryption of that token. For example you encrypted token with https://ci.appveyor.com/tools/encrypt, then pasted encrypted data to notifications settings UI and then exported to YAML. In this case token will be be double encrypted.

    Ilya.

  4. 4 Posted by Nicolas Ojeda B... on 14 Apr, 2017 03:25 AM

    Nicolas Ojeda Bar's Avatar

    Thanks Ilya!

  5. 5 Posted by Nicolas Ojeda B... on 14 Apr, 2017 12:49 PM

    Nicolas Ojeda Bar's Avatar

    This is solved, so it can be closed. Thanks again.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

19 Oct, 2017 02:25 AM
18 Oct, 2017 07:26 PM
18 Oct, 2017 11:00 AM
18 Oct, 2017 08:54 AM
18 Oct, 2017 07:42 AM

 

17 Oct, 2017 07:36 PM
17 Oct, 2017 05:39 PM
17 Oct, 2017 04:29 PM
17 Oct, 2017 07:49 AM
16 Oct, 2017 11:38 PM
16 Oct, 2017 10:01 PM