quarkiverse / quarkus-github-app

Develop your GitHub Apps in Java with Quarkus.
https://docs.quarkiverse.io/quarkus-github-app/dev/index.html
Apache License 2.0
60 stars 27 forks source link

github.myself as listed in documentation gives error #621

Open maxandersen opened 1 month ago

maxandersen commented 1 month ago

https://docs.quarkiverse.io/quarkus-github-app/dev/developer-reference.html#_injecting_a_github_instance says you can call github.getMySelf() but in reality you get this for bots:

Exception: org.kohsuke.github.HttpException: {"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/users/users#get-the-authenticated-user"}
        at org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:72)
        at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:504)
        at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:464)
        at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:427)
        at org.kohsuke.github.Requester.fetch(Requester.java:85)
        at org.kohsuke.github.GitHub.setMyself(GitHub.java:583)
        at org.kohsuke.github.GitHub.getMyself(GitHub.java:577)
        at GitHubBot.onDiscussionComment(GitHubBot.java:29)
        at GitHubBot_Multiplexer.onDiscussionComment_9c21b751bd1c3c76c9e9f8d4cbcacbc05e9e7ed7(Unknown Source)
        at GitHubBot_Multiplexer_Observer_onDiscussionComment_9c21b751bd1c3c76c9e9f8d4cbcacbc05e9e7ed7_9NrpxtbNW1zhm18uH5tGqg-sroo.notify(Unknown Source)
        at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:351)
        at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:333)
        at io.quarkus.arc.impl.EventImpl$1.get(EventImpl.java:110)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:599)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
gsmet commented 1 month ago

Oh. It used to be possible at some point as I tested it.

I will have a look soon.