@@ -1007,7 +1007,7 @@ public PagedIterable<GHUser> listCollaborators(CollaboratorAffiliation affiliati
1007
1007
1008
1008
/**
1009
1009
* Lists all
1010
- * <a href="https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/">the
1010
+ * <a href= "https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/">the
1011
1011
* available assignees</a> to which issues may be assigned.
1012
1012
*
1013
1013
* @return the paged iterable
@@ -2222,7 +2222,7 @@ public GHCommitStatus getLastCommitStatus(String sha1) throws IOException {
2222
2222
* @return check runs for given ref
2223
2223
* @throws IOException
2224
2224
* the io exception
2225
- * @see <a href="https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref">List check runs
2225
+ * @see <a href= "https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref">List check runs
2226
2226
* for a specific ref</a>
2227
2227
*/
2228
2228
public PagedIterable <GHCheckRun > getCheckRuns (String ref ) throws IOException {
@@ -2242,7 +2242,7 @@ public PagedIterable<GHCheckRun> getCheckRuns(String ref) throws IOException {
2242
2242
* @return check runs for the given ref
2243
2243
* @throws IOException
2244
2244
* the io exception
2245
- * @see <a href="https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref">List check runs
2245
+ * @see <a href= "https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref">List check runs
2246
2246
* for a specific ref</a>
2247
2247
*/
2248
2248
public PagedIterable <GHCheckRun > getCheckRuns (String ref , Map <String , Object > params ) throws IOException {
@@ -3568,7 +3568,8 @@ void populate() throws IOException {
3568
3568
3569
3569
// We don't use the URL provided in the JSON because it is not reliable:
3570
3570
// 1. There is bug in Push event payloads that returns the wrong url.
3571
- // For Push event repository records, they take the form "https://github.com/{fullName}".
3571
+ // For Push event repository records, they take the form
3572
+ // "https://github.com/{fullName}".
3572
3573
// All other occurrences of "url" take the form "https://api.github.com/...".
3573
3574
// 2. For Installation event payloads, the URL is not provided at all.
3574
3575
@@ -3649,6 +3650,23 @@ public List<GHRepositoryTrafficTopReferralSources> getTopReferralSources() throw
3649
3650
.fetch (GHRepositoryTrafficTopReferralSources [].class ));
3650
3651
}
3651
3652
3653
+ /**
3654
+ * Get all active rules that apply to the specified branch
3655
+ * (https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28#get-rules-for-a-branch).
3656
+ *
3657
+ * @param branch
3658
+ * the branch
3659
+ * @return the rules for branch
3660
+ * @throws IOException
3661
+ * the io exception
3662
+ */
3663
+ public PagedIterable <GHRepositoryRule > listRulesForBranch (String branch ) throws IOException {
3664
+ return root ().createRequest ()
3665
+ .method ("GET" )
3666
+ .withUrlPath (getApiTailUrl ("/rules/branches/" + branch ))
3667
+ .toIterable (GHRepositoryRule [].class , null );
3668
+ }
3669
+
3652
3670
/**
3653
3671
* A {@link GHRepositoryBuilder} that allows multiple properties to be updated per request.
3654
3672
*
0 commit comments