Open maciejwalkowiak opened 1 year ago
Did you configure a personal Git token? The default secrets.GITHUB_TOKEN
won't work for cross posting to a different git repository (homebrew-tap).
Nope, thats probably it! Thanks will try in the next release and will post here if it worked or not.
Anyways, I think the error could be improved (perhaps with exactly the same suggestion as you have commented).
Do you have access to the out/jreleaser/trace.log
? If so the full stacktrace may contain a hint to let JReleaser know what to do.
FWIW the docs cover the requirement for a PAT https://jreleaser.org/guide/latest/configuration/packagers/homebrew.html#_tokens but I agree the error message could be improved as well.
Not really as it's running on Github actions. Probably there is a way to access it but I think its not trivial (?) Perhaps there could be a flag to JReleaser to run in verbose mode to print it all to STDOUT?
You can grab the logs and store them
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v3
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
You may also configure debug mode when running the action to print everything to STDOUT
- name: Release
uses: jreleaser/release-action@v2
with:
arguments: full-release -g
Full stacktrace when attempting to update a tap repository using a GitHub token with insufficient permissions:
org.jreleaser.model.JReleaserException: Unexpected error
at org.jreleaser.engine.distribution.Distributions.processPackager(Distributions.java:145)
at org.jreleaser.engine.distribution.Distributions.processDistribution(Distributions.java:111)
at org.jreleaser.engine.distribution.Distributions.process(Distributions.java:95)
at org.jreleaser.workflow.PublishWorkflowItem.doInvoke(PublishWorkflowItem.java:37)
at org.jreleaser.workflow.AbstractWorkflowItem.lambda$invoke$0(AbstractWorkflowItem.java:43)
at org.jreleaser.engine.hooks.CommandHookExecutor.execute(CommandHookExecutor.java:52)
at org.jreleaser.workflow.AbstractWorkflowItem.invoke(AbstractWorkflowItem.java:43)
at org.jreleaser.workflow.WorkflowImpl.execute(WorkflowImpl.java:102)
at org.jreleaser.cli.Publish.doExecute(Publish.java:90)
at org.jreleaser.cli.AbstractModelCommand.execute(AbstractModelCommand.java:85)
at org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:36)
at org.jreleaser.cli.AbstractModelCommand.call(AbstractModelCommand.java:48)
at org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:29)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.jreleaser.cli.Main.execute(Main.java:72)
at org.jreleaser.cli.Main.run(Main.java:57)
at org.jreleaser.cli.Main.main(Main.java:48)
Caused by: org.jreleaser.model.spi.packagers.PackagerProcessingException: Unexpected error updating aalmiray/homebrew-test
at org.jreleaser.packagers.AbstractRepositoryPackagerProcessor.doPublishDistribution(AbstractRepositoryPackagerProcessor.java:138)
at org.jreleaser.packagers.AbstractPackagerProcessor.publishDistribution(AbstractPackagerProcessor.java:182)
at org.jreleaser.packagers.BrewPackagerProcessor.publishDistribution(BrewPackagerProcessor.java:74)
at org.jreleaser.engine.distribution.DistributionProcessor.publishDistribution(DistributionProcessor.java:141)
at org.jreleaser.engine.distribution.Distributions.processPackager(Distributions.java:140)
... 23 more
Caused by: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/user/repos {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user"}
at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:480)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:407)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355)
at org.kohsuke.github.Requester.fetch(Requester.java:76)
at org.kohsuke.github.AbstractBuilder.done(AbstractBuilder.java:108)
at org.kohsuke.github.GHRepositoryBuilder.done(GHRepositoryBuilder.java:242)
at org.kohsuke.github.GHCreateRepositoryBuilder.done(GHCreateRepositoryBuilder.java:12)
at org.kohsuke.github.GHCreateRepositoryBuilder.create(GHCreateRepositoryBuilder.java:132)
at org.jreleaser.sdk.github.Github.createRepository(Github.java:139)
at org.jreleaser.sdk.github.GithubReleaser.maybeCreateRepository(GithubReleaser.java:258)
at org.jreleaser.packagers.AbstractRepositoryPackagerProcessor.doPublishDistribution(AbstractRepositoryPackagerProcessor.java:69)
... 27 more
Caused by: java.io.FileNotFoundException: https://api.github.com/user/repos
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1974)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1969)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1968)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.bodyStream(GitHubHttpUrlConnectionClient.java:174)
at org.kohsuke.github.GitHubResponse$ResponseInfo.getBodyAsString(GitHubResponse.java:314)
at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:92)
at org.kohsuke.github.Requester.lambda$fetch$1(Requester.java:76)
at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:449)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:399)
... 36 more
Caused by: java.io.FileNotFoundException: https://api.github.com/user/repos
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1920)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
at org.kohsuke.github.GitHubHttpUrlConnectionClient.getResponseInfo(GitHubHttpUrlConnectionClient.java:63)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:387)
... 36 more
Publishing to Homebrew fails with:
when running through Github actions.
Output from: https://github.com/maciejwalkowiak/yolo/actions/runs/3418569714/jobs/5691146097
Running the same command from my localhost works. Perhaps the error logs could be improved to clearly states why does the publishing fails.