From ad75b43deeabeef0c0a90438656a0fa70946a5b7 Mon Sep 17 00:00:00 2001 From: Bob Langley Date: Wed, 29 Apr 2020 16:39:17 -0700 Subject: [PATCH] Support pull requests as project cards --- .../Clients/ProjectCardsClientTests.cs | 15 +++++++++++++++ Octokit/Models/Request/NewProjectCard.cs | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs index 3c127e0b9d..f4dc817a14 100644 --- a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs @@ -228,6 +228,21 @@ public async Task CreatesIssueCard() Assert.NotNull(card); } + [IntegrationTest] + public async Task CreatesPullRequestCard() + { + await _github.CreateTheWorld(_context.Repository); + + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + + var pullRequest = await _github.CreatePullRequest(_context.Repository); + + var column = await CreateColumnHelper(_github, project.Id); + var card = await CreateIssueCardHelper(_github, pullRequest.Number, column.Id); + + Assert.NotNull(card); + } + public void Dispose() { if (_context != null) diff --git a/Octokit/Models/Request/NewProjectCard.cs b/Octokit/Models/Request/NewProjectCard.cs index 35c8cb2886..a726467bdc 100644 --- a/Octokit/Models/Request/NewProjectCard.cs +++ b/Octokit/Models/Request/NewProjectCard.cs @@ -46,7 +46,9 @@ internal string DebuggerDisplay public enum ProjectCardContentType { - [Parameter(Value = "Issue")] - Issue + [Parameter(Value = nameof(Issue))] + Issue, + [Parameter(Value = nameof(PullRequest))] + PullRequest } }