1

I have a public repository on github, where i would like to create a release with c#. I watched a lot of documentation, and issues but a couldn't find what am i doing wrong. Here is my C# code:

 public static async Task CreateReleaseAsync(string title,string tag, string description, bool pre_release)
        {
            GitHubClient client = new GitHubClient(new ProductHeaderValue("MyApp"));
            Credentials basicAuth = new Credentials("repo-owner", "owner-password");
            client.Credentials = basicAuth;

            NewRelease release = new NewRelease(tag);
            release.Name = title;
            //release.Prerelease = pre_release;
            release.Body = description;
            release.Draft = true;

            Release basicRelease = await client.Repository.Release.Create("owner", "repo-name", release);
            //Here i also try to update but it won't even get here
            basicRelease.ToUpdate();
            Console.WriteLine("id: {0}",basicRelease.Id);
        }

If i don't use Task as return value, it would just crash with Octokit.NotFoundException: 'Not Found'

But with Task it stops and does nothing.

I tried

  • with personal token too
  • creating a ReleaseClient, but the lack of my searching skill or documentation I couldn't find anything
Stanley
  • 37
  • 4

0 Answers0