-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to add checks with app ids (#1844)
* feat: add ability to add checks with app ids as per https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#update-status-check-protection * test: add test to verify new checks are being populated * fix: some post-review changes and test additions * fix: allow null app ids to provide the same behaviour as the deprecated endpoint & post-review changes * test: regenerate some mocks --------- Co-authored-by: Liam Newman <[email protected]>
- Loading branch information
1 parent
3043691
commit 58c5976
Showing
22 changed files
with
990 additions
and
6 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
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
34 changes: 34 additions & 0 deletions
34
...g/kohsuke/github/GHBranchProtectionTest/wiremock/testChecksWithAppIds/__files/1-user.json
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,34 @@ | ||
{ | ||
"login": "tginiotis-at-work", | ||
"id": 61763026, | ||
"node_id": "MDQ6VXNlcjYxNzYzMDI2", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/61763026?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/tginiotis-at-work", | ||
"html_url": "https://github.com/tginiotis-at-work", | ||
"followers_url": "https://api.github.com/users/tginiotis-at-work/followers", | ||
"following_url": "https://api.github.com/users/tginiotis-at-work/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/tginiotis-at-work/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/tginiotis-at-work/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/tginiotis-at-work/subscriptions", | ||
"organizations_url": "https://api.github.com/users/tginiotis-at-work/orgs", | ||
"repos_url": "https://api.github.com/users/tginiotis-at-work/repos", | ||
"events_url": "https://api.github.com/users/tginiotis-at-work/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/tginiotis-at-work/received_events", | ||
"type": "User", | ||
"site_admin": false, | ||
"name": "Tadas Giniotis", | ||
"company": "IBM Lietuva", | ||
"blog": "", | ||
"location": null, | ||
"email": null, | ||
"hireable": null, | ||
"bio": null, | ||
"twitter_username": null, | ||
"public_repos": 12, | ||
"public_gists": 0, | ||
"followers": 0, | ||
"following": 0, | ||
"created_at": "2020-03-03T23:04:00Z", | ||
"updated_at": "2024-05-15T15:03:51Z" | ||
} |
156 changes: 156 additions & 0 deletions
156
...ProtectionTest/wiremock/testChecksWithAppIds/__files/2-r_h_temp-testcheckswithappids.json
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,156 @@ | ||
{ | ||
"id": 802086844, | ||
"node_id": "R_kgDOL87fvA", | ||
"name": "temp-testChecksWithAppIds", | ||
"full_name": "hub4j-test-org/temp-testChecksWithAppIds", | ||
"private": false, | ||
"owner": { | ||
"login": "hub4j-test-org", | ||
"id": 7544739, | ||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/hub4j-test-org", | ||
"html_url": "https://github.com/hub4j-test-org", | ||
"followers_url": "https://api.github.com/users/hub4j-test-org/followers", | ||
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", | ||
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", | ||
"repos_url": "https://api.github.com/users/hub4j-test-org/repos", | ||
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", | ||
"type": "Organization", | ||
"site_admin": false | ||
}, | ||
"html_url": "https://github.com/hub4j-test-org/temp-testChecksWithAppIds", | ||
"description": "A test repository for testing the github-api project: temp-testChecksWithAppIds", | ||
"fork": false, | ||
"url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds", | ||
"forks_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/forks", | ||
"keys_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/keys{/key_id}", | ||
"collaborators_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/collaborators{/collaborator}", | ||
"teams_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/teams", | ||
"hooks_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/hooks", | ||
"issue_events_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/issues/events{/number}", | ||
"events_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/events", | ||
"assignees_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/assignees{/user}", | ||
"branches_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/branches{/branch}", | ||
"tags_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/tags", | ||
"blobs_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/git/blobs{/sha}", | ||
"git_tags_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/git/tags{/sha}", | ||
"git_refs_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/git/refs{/sha}", | ||
"trees_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/git/trees{/sha}", | ||
"statuses_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/statuses/{sha}", | ||
"languages_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/languages", | ||
"stargazers_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/stargazers", | ||
"contributors_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/contributors", | ||
"subscribers_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/subscribers", | ||
"subscription_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/subscription", | ||
"commits_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/commits{/sha}", | ||
"git_commits_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/git/commits{/sha}", | ||
"comments_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/comments{/number}", | ||
"issue_comment_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/issues/comments{/number}", | ||
"contents_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/contents/{+path}", | ||
"compare_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/compare/{base}...{head}", | ||
"merges_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/merges", | ||
"archive_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/{archive_format}{/ref}", | ||
"downloads_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/downloads", | ||
"issues_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/issues{/number}", | ||
"pulls_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/pulls{/number}", | ||
"milestones_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/milestones{/number}", | ||
"notifications_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/notifications{?since,all,participating}", | ||
"labels_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/labels{/name}", | ||
"releases_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/releases{/id}", | ||
"deployments_url": "https://api.github.com/repos/hub4j-test-org/temp-testChecksWithAppIds/deployments", | ||
"created_at": "2024-05-17T13:51:56Z", | ||
"updated_at": "2024-05-17T13:52:00Z", | ||
"pushed_at": "2024-05-17T13:51:57Z", | ||
"git_url": "git://github.com/hub4j-test-org/temp-testChecksWithAppIds.git", | ||
"ssh_url": "[email protected]:hub4j-test-org/temp-testChecksWithAppIds.git", | ||
"clone_url": "https://github.com/hub4j-test-org/temp-testChecksWithAppIds.git", | ||
"svn_url": "https://github.com/hub4j-test-org/temp-testChecksWithAppIds", | ||
"homepage": "http://github-api.kohsuke.org/", | ||
"size": 0, | ||
"stargazers_count": 0, | ||
"watchers_count": 0, | ||
"language": null, | ||
"has_issues": true, | ||
"has_projects": true, | ||
"has_downloads": true, | ||
"has_wiki": true, | ||
"has_pages": false, | ||
"has_discussions": false, | ||
"forks_count": 0, | ||
"mirror_url": null, | ||
"archived": false, | ||
"disabled": false, | ||
"open_issues_count": 0, | ||
"license": null, | ||
"allow_forking": true, | ||
"is_template": false, | ||
"web_commit_signoff_required": false, | ||
"topics": [], | ||
"visibility": "public", | ||
"forks": 0, | ||
"open_issues": 0, | ||
"watchers": 0, | ||
"default_branch": "main", | ||
"permissions": { | ||
"admin": true, | ||
"maintain": true, | ||
"push": true, | ||
"triage": true, | ||
"pull": true | ||
}, | ||
"temp_clone_token": "", | ||
"allow_squash_merge": true, | ||
"allow_merge_commit": true, | ||
"allow_rebase_merge": true, | ||
"allow_auto_merge": false, | ||
"delete_branch_on_merge": false, | ||
"allow_update_branch": false, | ||
"use_squash_pr_title_as_default": false, | ||
"squash_merge_commit_message": "COMMIT_MESSAGES", | ||
"squash_merge_commit_title": "COMMIT_OR_PR_TITLE", | ||
"merge_commit_message": "PR_TITLE", | ||
"merge_commit_title": "MERGE_MESSAGE", | ||
"custom_properties": {}, | ||
"organization": { | ||
"login": "hub4j-test-org", | ||
"id": 7544739, | ||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/hub4j-test-org", | ||
"html_url": "https://github.com/hub4j-test-org", | ||
"followers_url": "https://api.github.com/users/hub4j-test-org/followers", | ||
"following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", | ||
"organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", | ||
"repos_url": "https://api.github.com/users/hub4j-test-org/repos", | ||
"events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", | ||
"type": "Organization", | ||
"site_admin": false | ||
}, | ||
"security_and_analysis": { | ||
"secret_scanning": { | ||
"status": "disabled" | ||
}, | ||
"secret_scanning_push_protection": { | ||
"status": "disabled" | ||
}, | ||
"dependabot_security_updates": { | ||
"status": "disabled" | ||
}, | ||
"secret_scanning_validity_checks": { | ||
"status": "disabled" | ||
} | ||
}, | ||
"network_count": 0, | ||
"subscribers_count": 22 | ||
} |
Oops, something went wrong.