-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: `pull_request.head.repo` can be `null` * feat: new `secret_scanning_alert.revoked` event * fix!: `pull_request.queued` was renamed to `pull_request.enqueued` * feat: new `secret_scanning_alert_location` event * feat: new `require_last_push_approval` rule for `branch_protection_rule` * fix: `SecretScanningAlertLocationCreatedEvent` inherits from `SecretScanningAlertLocationEvent` * test: update sample payloads
- Loading branch information
1 parent
9d170dc
commit ba0b8f2
Showing
24 changed files
with
335 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/Octokit.Webhooks/Events/PullRequest/PullRequestEnqueuedEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Octokit.Webhooks.Events.PullRequest; | ||
|
||
[PublicAPI] | ||
[WebhookActionType(PullRequestActionValue.Enqueued)] | ||
public sealed record PullRequestEnqueuedEvent : PullRequestEvent | ||
{ | ||
[JsonPropertyName("action")] | ||
public override string Action => PullRequestAction.Enqueued; | ||
} |
9 changes: 0 additions & 9 deletions
9
src/Octokit.Webhooks/Events/PullRequest/PullRequestQueuedEvent.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/Octokit.Webhooks/Events/SecretScanningAlert/SecretScanningAlertRevokedEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Octokit.Webhooks.Events.SecretScanningAlert; | ||
|
||
[PublicAPI] | ||
[WebhookActionType(SecretScanningAlertActionValue.Revoked)] | ||
public sealed record SecretScanningAlertRevokedEvent : SecretScanningAlertEvent | ||
{ | ||
[JsonPropertyName("action")] | ||
public override string Action => SecretScanningAlertAction.Revoked; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Octokit.Webhooks/Events/SecretScanningAlertLocation/SecretScanningAlertLocationAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Octokit.Webhooks.Events.SecretScanningAlertLocation; | ||
|
||
[PublicAPI] | ||
public sealed record SecretScanningAlertLocationAction : WebhookEventAction | ||
{ | ||
public static readonly SecretScanningAlertLocationAction Created = new(SecretScanningAlertLocationActionValue.Created); | ||
|
||
private SecretScanningAlertLocationAction(string value) | ||
: base(value) | ||
{ | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...kit.Webhooks/Events/SecretScanningAlertLocation/SecretScanningAlertLocationActionValue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Octokit.Webhooks.Events.SecretScanningAlertLocation; | ||
|
||
public static class SecretScanningAlertLocationActionValue | ||
{ | ||
public const string Created = "created"; | ||
} |
9 changes: 9 additions & 0 deletions
9
...it.Webhooks/Events/SecretScanningAlertLocation/SecretScanningAlertLocationCreatedEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Octokit.Webhooks.Events.SecretScanningAlertLocation; | ||
|
||
[PublicAPI] | ||
[WebhookActionType(SecretScanningAlertLocationActionValue.Created)] | ||
public sealed record SecretScanningAlertLocationCreatedEvent : SecretScanningAlertLocationEvent | ||
{ | ||
[JsonPropertyName("action")] | ||
public override string Action => SecretScanningAlertLocationAction.Created; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Octokit.Webhooks/Events/SecretScanningAlertLocationEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Octokit.Webhooks.Events; | ||
|
||
using Octokit.Webhooks.Models.SecretScanningAlertEvent; | ||
|
||
[PublicAPI] | ||
[WebhookEventType(WebhookEventType.SecretScanningAlertLocation)] | ||
[JsonConverter(typeof(WebhookConverter<SecretScanningAlertLocationEvent>))] | ||
public abstract record SecretScanningAlertLocationEvent : WebhookEvent | ||
{ | ||
[JsonPropertyName("alert")] | ||
public Alert Alert { get; init; } = null!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Octokit.Webhooks/Models/SecretScanningAlertLocationEvent/SecretScanningLocation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Octokit.Webhooks.Models.SecretScanningAlertLocationEvent; | ||
|
||
[PublicAPI] | ||
public sealed record SecretScanningLocation | ||
{ | ||
[JsonPropertyName("type")] | ||
public SecretScanningLocationType Type { get; init; } | ||
|
||
// TODO: type union with SecretScanningLocationCommit, SecretScanningLocationIssueBody, etc. | ||
[JsonPropertyName("details")] | ||
public dynamic Details { get; init; } = null!; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Octokit.Webhooks/Models/SecretScanningAlertLocationEvent/SecretScanningLocationCommit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Octokit.Webhooks.Models.SecretScanningAlertLocationEvent; | ||
|
||
[PublicAPI] | ||
public sealed record SecretScanningLocationCommit | ||
{ | ||
[JsonPropertyName("path")] | ||
public string Path { get; init; } = null!; | ||
|
||
[JsonPropertyName("start_line")] | ||
public long StartLine { get; init; } | ||
|
||
[JsonPropertyName("end_line")] | ||
public long EndLine { get; init; } | ||
|
||
[JsonPropertyName("start_column")] | ||
public long StartColumn { get; init; } | ||
|
||
[JsonPropertyName("end_column")] | ||
public long EndColumn { get; init; } | ||
|
||
[JsonPropertyName("blob_sha")] | ||
public string BlobSha { get; init; } = null!; | ||
|
||
[JsonPropertyName("blob_url")] | ||
public string BlobUrl { get; init; } = null!; | ||
|
||
[JsonPropertyName("commit_sha")] | ||
public string CommitSha { get; init; } = null!; | ||
|
||
[JsonPropertyName("commit_url")] | ||
public string CommitUrl { get; init; } = null!; | ||
} |
8 changes: 8 additions & 0 deletions
8
...tokit.Webhooks/Models/SecretScanningAlertLocationEvent/SecretScanningLocationIssueBody.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Octokit.Webhooks.Models.SecretScanningAlertLocationEvent; | ||
|
||
[PublicAPI] | ||
public sealed record SecretScanningLocationIssueBody | ||
{ | ||
[JsonPropertyName("issue_body_url")] | ||
public string IssueBodyUrl { get; init; } = null!; | ||
} |
8 changes: 8 additions & 0 deletions
8
...it.Webhooks/Models/SecretScanningAlertLocationEvent/SecretScanningLocationIssueComment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Octokit.Webhooks.Models.SecretScanningAlertLocationEvent; | ||
|
||
[PublicAPI] | ||
public sealed record SecretScanningLocationIssueComment | ||
{ | ||
[JsonPropertyName("issue_comment_url")] | ||
public string IssueCommentUrl { get; init; } = null!; | ||
} |
8 changes: 8 additions & 0 deletions
8
...okit.Webhooks/Models/SecretScanningAlertLocationEvent/SecretScanningLocationIssueTitle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Octokit.Webhooks.Models.SecretScanningAlertLocationEvent; | ||
|
||
[PublicAPI] | ||
public sealed record SecretScanningLocationIssueTitle | ||
{ | ||
[JsonPropertyName("issue_title_url")] | ||
public string IssueTitleUrl { get; init; } = null!; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Octokit.Webhooks/Models/SecretScanningAlertLocationEvent/SecretScanningLocationType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Octokit.Webhooks.Models.SecretScanningAlertLocationEvent; | ||
|
||
[PublicAPI] | ||
[JsonConverter(typeof(JsonStringEnumMemberConverterWithFallback))] | ||
public enum SecretScanningLocationType | ||
{ | ||
Unknown = -1, | ||
[EnumMember(Value = "commit")] | ||
Commit, | ||
[EnumMember(Value = "issue_title")] | ||
IssueTitle, | ||
[EnumMember(Value = "issue_body")] | ||
IssueBody, | ||
[EnumMember(Value = "issue_comment")] | ||
IssueComment, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.