-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Type: MaintenanceAny dependency, housekeeping, and clean up Issue or PRAny dependency, housekeeping, and clean up Issue or PR
Description
Using LINQpad and OctoKit, for my testing repository, I have utilized the GitHub website to add a tag called 'v0.7.3' for testing purposes. The code
/* Assuming the client variable is a GitHubClient that is properly authenticated and
that repoOwner and repoName reference a repository to which I have full permissions */
var refs = await client.Git.Reference.GetAll(repoOwner, repoName);
refs.Select(r => r.Ref).Dump();
return;
produces the result

Then, when I do
/* Assuming the client variable is a GitHubClient that is properly authenticated and
that repoOwner and repoName reference a repository to which I have full permissions */
var refs = await client.Git.Reference.GetAll(repoOwner, repoName);
foreach (var tagRef in refs)
{
if (!tagRef.Ref.Contains("v0.7.3"))
continue;
await client.Git.Reference.Delete(repoOwner,
repoName, tagRef.Ref);
}
Which should work, since the if branch does indeed let the loop move to the await client.Git.Reference.Delete line if I single-step, since tag matching the criteria does indeed exist (as has been shown above). However, upon calling await client.Git.Reference.Delete(...) on a tag that exists* I get the ApiValidationException shown

This counter-intuitive. Why is the API telling me my reference does not exist when it clearly does?
To reproduce:
- Sign in to GitHub.com website in any browser.
- Create a new Repo under your account with a README.md
- Alter the README.md and commit it
- Note the repo's name and your GitHub username
- In your browser, create a tag with whichever name you want
- Run the code in the second block above (with the appropriate authentication, repo owner, repo name, and tag search criteria.
- Note that the exception occurs.
Metadata
Metadata
Assignees
Labels
Type: MaintenanceAny dependency, housekeeping, and clean up Issue or PRAny dependency, housekeeping, and clean up Issue or PR