Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BranchProtectionRuleEvent Installation field #2216

Merged
merged 2 commits into from Dec 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions github/event_types.go
Expand Up @@ -20,12 +20,13 @@ type RequestedAction struct {
//
// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule
type BranchProtectionRuleEvent struct {
Action *string `json:"action,omitempty"`
Rule *BranchProtectionRule `json:"rule,omitempty"`
Changes *ProtectionChanges `json:"changes,omitempty"`
Repo *Repository `json:"repository,omitempty"`
Org *Organization `json:"organization,omitempty"`
Sender *User `json:"sender,omitempty"`
Action *string `json:"action,omitempty"`
Rule *BranchProtectionRule `json:"rule,omitempty"`
Changes *ProtectionChanges `json:"changes,omitempty"`
Repo *Repository `json:"repository,omitempty"`
Org *Organization `json:"organization,omitempty"`
Sender *User `json:"sender,omitempty"`
Installation *Installation `json:"installation,omitempty"`
}

// CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested".
Expand Down
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions scrape/testdata/access-restrictions-disabled.html
Expand Up @@ -2,16 +2,16 @@
Some extraneous markup removed to keep the file size smaller -->
<html lang="en">
<body class="logged-in env-production min-width-lg">

<div class="application-main " data-commit-hovercards-enabled>
<main id="js-pjax-container" data-pjax-container>

<div itemscope itemtype="http://schema.org/Organization">

<div class="container-lg px-3 d-flex">

<div class="col-9">

<div class="boxed-group oauth-application-whitelist ">
<h3>Third-party application access policy</h3>
<div class="boxed-group-inner">
Expand Down
24 changes: 12 additions & 12 deletions scrape/testdata/access-restrictions-enabled.html
Expand Up @@ -2,18 +2,18 @@
Some extraneous markup removed to keep the file size smaller -->
<html lang="en">
<body class="logged-in env-production min-width-lg">

<div class="application-main " data-commit-hovercards-enabled>
<main id="js-pjax-container" data-pjax-container>



<div itemscope itemtype="http://schema.org/Organization">

<div class="container-lg px-3 d-flex">

<div class="col-9">

<div class="boxed-group oauth-application-whitelist is-selectable">
<h3>Third-party application access policy</h3>
<div class="boxed-group-inner">
Expand All @@ -23,32 +23,32 @@ <h3>Third-party application access policy</h3>
<p>
Only approved applications can access data in this organization. Applications owned by <strong>google-test</strong> always have access.
</p>

<details
class="details-reset details-overlay details-overlay-dark lh-default text-gray-dark d-inline-block text-left"
>
<summary
class="btn btn-danger"




>

Remove restrictions
</summary>
<details-dialog
aria-label="Are you sure?"
class="Box Box--overlay d-flex flex-column anim-fade-in fast "

>
<div class="Box-header">
<button class="Box-btn-octicon btn-octicon float-right" type="button" aria-label="Close dialog" data-close-dialog>
<svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg>
</button>
<h3 class="Box-title ">Are you sure?</h3>
</div>

<div class="flash flash-full flash-warn">
You’re about to remove all third-party application restrictions. Please read this carefully.
</div>
Expand All @@ -69,7 +69,7 @@ <h3 class="Box-title ">Are you sure?</h3>
<ul class="boxed-group-list">
<li>
<div class="float-right request-indicator">
Approval requested by <a class="requestor" href="/willnorris">willnorris</a> &#8212;
Approval requested by <a class="requestor" href="/willnorris">willnorris</a> &#8212;
<a href="/orgs/google-test/policies/applications/22222">Review</a>
</div>
<img class="avatar float-left" src="https://avatars3.githubusercontent.com/oa/22222?s=40&amp;u=90a5890234f8061be4c6c0b29b4fa7594f2ba2d7&amp;v=4" height="20" width="20" alt="" />
Expand Down