Skip to content

Commit

Permalink
Handle requested_action field for check-runs. (#2197)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdenny authored Jun 5, 2020
1 parent 17050e8 commit b9d1f44
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Octokit.Tests/Models/CheckRunEventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public void CanBeDeserialized()
]
},
""requested_action"": {
""identifier"": ""dosomeaction""
},
""repository"": {
""id"": 526,
""node_id"": ""MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM="",
Expand Down Expand Up @@ -248,6 +251,7 @@ public void CanBeDeserialized()
Assert.Equal(4, payload.CheckRun.Id);
Assert.Equal(CheckStatus.Completed, payload.CheckRun.Status);
Assert.Equal(CheckConclusion.Neutral, payload.CheckRun.Conclusion);
Assert.Equal("dosomeaction", payload.RequestedAction.Identifier);
Assert.Equal(5, payload.CheckRun.CheckSuite.Id);
Assert.Equal(CheckStatus.Completed, payload.CheckRun.CheckSuite.Status.Value);
Assert.Equal(CheckConclusion.Neutral, payload.CheckRun.CheckSuite.Conclusion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public class CheckRunEventPayload : ActivityPayload
{
public string Action { get; protected set; }
public CheckRun CheckRun { get; protected set; }
public CheckRunRequestedAction RequestedAction { get; protected set; }
}
}
27 changes: 27 additions & 0 deletions Octokit/Models/Response/CheckRunRequestedAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;

namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CheckRunRequestedAction
{
public CheckRunRequestedAction()
{
}

public CheckRunRequestedAction(string identifier)
{
Identifier = identifier;
}

/// <summary>
/// The Identifier of the check run requested action.
/// </summary>
public string Identifier { get; protected set; }

internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Identifier: {0}", Identifier);
}
}

0 comments on commit b9d1f44

Please sign in to comment.