mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Add a build task to validate LINQPad samples (#1551)
* add a build task to run LINQPad samples * make modifications to the validation of LINQPad samples * rename the CAKE task to its original name ValidateLINQPadSamples * rename the LINQPad samples file so they get executed in ordinal order (1, 2, ..., 10 and not 1, 10, 2, ...) * remove openssl linking in TravisCI when on macOS
This commit is contained in:
committed by
Ryan Gribble
parent
13d5dab516
commit
3369a4aea1
35
samples/linqpad-samples/05-interact-with-git-database.linq
Normal file
35
samples/linqpad-samples/05-interact-with-git-database.linq
Normal file
@@ -0,0 +1,35 @@
|
||||
<Query Kind="Program">
|
||||
<NuGetReference>Octokit</NuGetReference>
|
||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||
<NuGetReference>Rx-Main</NuGetReference>
|
||||
<Namespace>Octokit</Namespace>
|
||||
<Namespace>System.Threading.Tasks</Namespace>
|
||||
</Query>
|
||||
|
||||
async Task Main(string[] args)
|
||||
{
|
||||
var owner = string.Empty;
|
||||
var reponame = string.Empty;
|
||||
|
||||
GitHubClient client = new GitHubClient(new Octokit.ProductHeaderValue("Octokit.samples"));
|
||||
|
||||
owner = "octokit";
|
||||
reponame = "octokit.net";
|
||||
|
||||
|
||||
var releases = await client.Repository.Release.GetAll(owner, reponame);
|
||||
|
||||
// we have to build up this tag because release tags
|
||||
// are just lightweight tags. you can read more about
|
||||
// the differences between lightweight tags and annotated tags
|
||||
// here: http://git-scm.com/book/en/Git-Basics-Tagging#Creating-Tags
|
||||
|
||||
// we can fetch the tag for this release
|
||||
var reference = "tags/" + releases[0].TagName;
|
||||
var tag = await client.Git.Reference.Get(owner, reponame, reference);
|
||||
tag.Dump();
|
||||
|
||||
// and we can fetch the commit associated with this release
|
||||
var commit = await client.Git.Commit.Get(owner, reponame, tag.Object.Sha);
|
||||
commit.Dump();
|
||||
}
|
||||
Reference in New Issue
Block a user