Skip to content

Commit 5e141c3

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pagination-cleanup2
2 parents 01f8dfa + 3745013 commit 5e141c3

File tree

25 files changed

+922
-60
lines changed

25 files changed

+922
-60
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ jobs:
4242

4343
steps:
4444
- name: Set up JDK
45-
uses: actions/setup-java@v4
45+
uses: actions/setup-java@v5
4646
with:
4747
distribution: 'temurin'
4848
java-version: 17
4949

5050
- name: Checkout repository
51-
uses: actions/checkout@v4
51+
uses: actions/checkout@v5
5252

5353
# Initializes the CodeQL tools for scanning.
5454
- name: Initialize CodeQL

.github/workflows/create_release_tag_and_pr.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,50 @@ jobs:
1010
create_release_tag:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414
with:
1515
fetch-depth: 0
1616

1717
- name: Set up Maven Central Repository
18-
uses: actions/setup-java@v4
18+
uses: actions/setup-java@v5
1919
with:
2020
java-version: '17'
2121
distribution: 'temurin'
2222
cache: 'maven'
2323

24-
- name: Reset staging/main
24+
- name: Reset staging
2525
id: staging
2626
run: |
27-
git checkout -B staging/main
28-
git push --set-upstream -f origin staging/main
27+
git checkout -B staging/$GITHUB_REF_NAME
28+
git push --set-upstream -f origin staging/$GITHUB_REF_NAME
29+
env:
30+
GITHUB_REF_NAME: ${{ github.ref_name }}
2931

3032
- name: Set Release Version
3133
id: release
3234
run: |
3335
mvn -B versions:set versions:commit -DremoveSnapshot
3436
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
3537
36-
- uses: stefanzweifel/git-auto-commit-action@v5
38+
- uses: stefanzweifel/git-auto-commit-action@v6
3739
with:
3840
commit_message: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
3941
tagging_message: 'github-api-${{ steps.release.outputs.version }}'
40-
branch: staging/main
42+
branch: staging/${{ github.ref_name }}
4143

4244
- name: Increment Snapshot Version
4345
run: |
4446
mvn versions:set versions:commit -DnextSnapshot
4547
46-
- uses: stefanzweifel/git-auto-commit-action@v5
48+
- uses: stefanzweifel/git-auto-commit-action@v6
4749
with:
4850
commit_message: "Prepare for next development iteration"
49-
branch: staging/main
51+
branch: staging/${{ github.ref_name }}
5052

51-
- name: pull-request to main
53+
- name: Create pull-request
5254
uses: repo-sync/pull-request@v2
5355
with:
5456
pr_title: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
55-
source_branch: "staging/main"
56-
destination_branch: "main"
57+
source_branch: "staging/${{ github.ref_name }}"
58+
destination_branch: "${{ github.ref_name }}"
5759
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/maven-build.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
strategy:
2626
fail-fast: true
2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
2929
- name: Set up JDK
30-
uses: actions/setup-java@v4
30+
uses: actions/setup-java@v5
3131
with:
3232
java-version: 17
3333
distribution: 'temurin'
@@ -47,9 +47,9 @@ jobs:
4747
strategy:
4848
fail-fast: false
4949
steps:
50-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@v5
5151
- name: Set up JDK
52-
uses: actions/setup-java@v4
52+
uses: actions/setup-java@v5
5353
with:
5454
java-version: 17
5555
distribution: 'temurin'
@@ -68,9 +68,9 @@ jobs:
6868
strategy:
6969
fail-fast: true
7070
steps:
71-
- uses: actions/checkout@v4
71+
- uses: actions/checkout@v5
7272
- name: Set up JDK
73-
uses: actions/setup-java@v4
73+
uses: actions/setup-java@v5
7474
with:
7575
java-version: 17
7676
distribution: 'temurin'
@@ -90,9 +90,9 @@ jobs:
9090
os: [ ubuntu, windows ]
9191
java: [ 17, 21 ]
9292
steps:
93-
- uses: actions/checkout@v4
93+
- uses: actions/checkout@v5
9494
- name: Set up JDK
95-
uses: actions/setup-java@v4
95+
uses: actions/setup-java@v5
9696
with:
9797
java-version: ${{ matrix.java }}
9898
distribution: 'temurin'
@@ -120,13 +120,13 @@ jobs:
120120
needs: test
121121
runs-on: ubuntu-latest
122122
steps:
123-
- uses: actions/checkout@v4
124-
- uses: actions/download-artifact@v4
123+
- uses: actions/checkout@v5
124+
- uses: actions/download-artifact@v5
125125
with:
126126
name: maven-test-target-directory
127127
path: target
128128
- name: Codecov Report
129-
uses: codecov/codecov-action@v5.4.0
129+
uses: codecov/codecov-action@v5.5.0
130130
with:
131131
# Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings
132132
token: ${{ secrets.CODECOV_TOKEN }}
@@ -138,13 +138,13 @@ jobs:
138138
needs: build
139139
runs-on: ubuntu-latest
140140
steps:
141-
- uses: actions/checkout@v4
142-
- uses: actions/download-artifact@v4
141+
- uses: actions/checkout@v5
142+
- uses: actions/download-artifact@v5
143143
with:
144144
name: maven-target-directory
145145
path: target
146146
- name: Set up JDK
147-
uses: actions/setup-java@v4
147+
uses: actions/setup-java@v5
148148
with:
149149
java-version: 11
150150
distribution: 'temurin'

.github/workflows/publish_release_branch.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- name: Set up Maven Central Repository
17-
uses: actions/setup-java@v4
17+
uses: actions/setup-java@v5
1818
with:
1919
java-version: '17'
2020
distribution: 'temurin'
@@ -35,9 +35,9 @@ jobs:
3535
runs-on: ubuntu-latest
3636
needs: build
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v5
3939
- name: Set up Maven Central Repository
40-
uses: actions/setup-java@v4
40+
uses: actions/setup-java@v5
4141
with:
4242
java-version: '17'
4343
distribution: 'temurin'
@@ -69,7 +69,7 @@ jobs:
6969
needs: build
7070
if: ${{ github.ref == 'refs/heads/release/v2.x' }}
7171
steps:
72-
- uses: actions/checkout@v4
72+
- uses: actions/checkout@v5
7373
with:
7474
fetch-depth: 0
7575

@@ -78,7 +78,7 @@ jobs:
7878
run: |
7979
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
8080
81-
- uses: actions/download-artifact@v4
81+
- uses: actions/download-artifact@v5
8282
with:
8383
name: maven-release-target-directory
8484
path: target
@@ -90,7 +90,7 @@ jobs:
9090
cp -r ./target/site/* ./
9191
9292
- name: Publish GH Pages
93-
uses: stefanzweifel/git-auto-commit-action@v5
93+
uses: stefanzweifel/git-auto-commit-action@v6
9494
with:
9595
commit_message: "Release (${{ github.actor }}): v${{ steps.release.outputs.version }}"
9696
branch: gh-pages

pom.xml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.kohsuke</groupId>
55
<artifactId>${github-api.artifactId}</artifactId>
6-
<version>2.0-rc.4-SNAPSHOT</version>
6+
<version>2.0-rc.6-SNAPSHOT</version>
77
<name>GitHub API for Java</name>
88
<description>GitHub API for Java</description>
99
<url>https://hub4j.github.io/github-api/</url>
@@ -73,9 +73,9 @@
7373
<jacoco.surefire.argLine></jacoco.surefire.argLine>
7474
<jjwt.suite.version>0.12.6</jjwt.suite.version>
7575
<!-- This project was registered before 2021, so it uses the old server. -->
76-
<nexus.serverUrl>https://oss.sonatype.org</nexus.serverUrl>
76+
<nexus.serverUrl>https://ossrh-staging-api.central.sonatype.com</nexus.serverUrl>
7777
<okhttp3.version>4.12.0</okhttp3.version>
78-
<okio.version>3.10.2</okio.version>
78+
<okio.version>3.16.0</okio.version>
7979
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8080
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
8181
<spotbugs-maven-plugin.version>4.9.3.0</spotbugs-maven-plugin.version>
@@ -89,14 +89,14 @@
8989
<dependency>
9090
<groupId>com.fasterxml.jackson</groupId>
9191
<artifactId>jackson-bom</artifactId>
92-
<version>2.18.3</version>
92+
<version>2.20.0</version>
9393
<type>pom</type>
9494
<scope>import</scope>
9595
</dependency>
9696
<dependency>
9797
<groupId>org.junit</groupId>
9898
<artifactId>junit-bom</artifactId>
99-
<version>5.12.1</version>
99+
<version>5.13.4</version>
100100
<type>pom</type>
101101
<scope>import</scope>
102102
</dependency>
@@ -146,11 +146,15 @@
146146
<groupId>com.fasterxml.jackson.datatype</groupId>
147147
<artifactId>jackson-datatype-jsr310</artifactId>
148148
</dependency>
149+
<dependency>
150+
<groupId>com.github.spotbugs</groupId>
151+
<artifactId>spotbugs-annotations</artifactId>
152+
<version>${spotbugs.version}</version>
153+
</dependency>
149154
<dependency>
150155
<groupId>com.infradna.tool</groupId>
151156
<artifactId>bridge-method-annotation</artifactId>
152-
<version>1.30</version>
153-
<optional>true</optional>
157+
<version>1.31</version>
154158
</dependency>
155159
<dependency>
156160
<groupId>com.squareup.okhttp3</groupId>
@@ -190,13 +194,7 @@
190194
<dependency>
191195
<groupId>org.apache.commons</groupId>
192196
<artifactId>commons-lang3</artifactId>
193-
<version>3.17.0</version>
194-
</dependency>
195-
<dependency>
196-
<groupId>com.github.spotbugs</groupId>
197-
<artifactId>spotbugs-annotations</artifactId>
198-
<version>${spotbugs.version}</version>
199-
<scope>provided</scope>
197+
<version>3.18.0</version>
200198
</dependency>
201199
<dependency>
202200
<groupId>com.github.npathai</groupId>
@@ -225,7 +223,7 @@
225223
<dependency>
226224
<groupId>com.tngtech.archunit</groupId>
227225
<artifactId>archunit</artifactId>
228-
<version>1.4.0</version>
226+
<version>1.4.1</version>
229227
<scope>test</scope>
230228
</dependency>
231229
<dependency>
@@ -310,7 +308,7 @@
310308
<plugin>
311309
<groupId>com.infradna.tool</groupId>
312310
<artifactId>bridge-method-injector</artifactId>
313-
<version>1.30</version>
311+
<version>1.31</version>
314312
<executions>
315313
<execution>
316314
<goals>
@@ -364,7 +362,7 @@
364362
<plugin>
365363
<groupId>org.jacoco</groupId>
366364
<artifactId>jacoco-maven-plugin</artifactId>
367-
<version>0.8.12</version>
365+
<version>0.8.13</version>
368366
<configuration>
369367
<!-- no need to get data about external code. It dramatically reduces performance of JaCoCo for nothing -->
370368
<excludes>
@@ -475,7 +473,7 @@
475473
<plugin>
476474
<groupId>com.diffplug.spotless</groupId>
477475
<artifactId>spotless-maven-plugin</artifactId>
478-
<version>2.44.3</version>
476+
<version>2.46.1</version>
479477
<configuration>
480478
<java>
481479
<includes>
@@ -494,10 +492,10 @@
494492
<importOrder>
495493
<file>${basedir}/src/build/eclipse/eclipse.importorder</file>
496494
</importOrder>
497-
495+
498496
<removeUnusedImports></removeUnusedImports>
499-
<formatAnnotations />
500-
497+
<formatAnnotations></formatAnnotations>
498+
501499
<trimTrailingWhitespace></trimTrailingWhitespace>
502500
<endWithNewline></endWithNewline>
503501

src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ public GHCreateRepositoryBuilder gitignoreTemplate(String language) throws IOExc
9898
return with("gitignore_template", language);
9999
}
100100

101+
/**
102+
* Include all branches when creating from a template repository
103+
*
104+
* @param includeAllBranches
105+
* whether or not to include all branches from the template repository
106+
* @return a builder to continue with building
107+
* @throws IOException
108+
* In case of any networking error or error from the server.
109+
*/
110+
public GHCreateRepositoryBuilder includeAllBranches(boolean includeAllBranches) throws IOException {
111+
return with("include_all_branches", includeAllBranches);
112+
}
113+
101114
/**
102115
* Desired license template to apply.
103116
*

src/main/java/org/kohsuke/github/GHRepository.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,9 @@ public GHIssueEvent getIssueEvent(long id) throws IOException {
16051605
* @return the issues
16061606
* @throws IOException
16071607
* the io exception
1608+
* @deprecated Use {@link #queryIssues()} instead.
16081609
*/
1610+
@Deprecated
16091611
public List<GHIssue> getIssues(GHIssueState state) throws IOException {
16101612
return queryIssues().state(state).list().toList();
16111613
}
@@ -1620,7 +1622,9 @@ public List<GHIssue> getIssues(GHIssueState state) throws IOException {
16201622
* @return the issues
16211623
* @throws IOException
16221624
* the io exception
1625+
* @deprecated Use {@link #queryIssues()} instead.
16231626
*/
1627+
@Deprecated
16241628
public List<GHIssue> getIssues(GHIssueState state, GHMilestone milestone) throws IOException {
16251629
return queryIssues().milestone(milestone == null ? "none" : "" + milestone.getNumber())
16261630
.state(state)

src/main/java/org/kohsuke/github/GHWorkflowRun.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public String toString() {
207207
return name().toLowerCase(Locale.ROOT);
208208
}
209209
}
210+
private GHUser actor;
210211
private String artifactsUrl;
211212
private String cancelUrl;
212213
private String checkSuiteUrl;
@@ -307,6 +308,16 @@ public <T> T downloadLogs(InputStreamFunction<T> streamFunction) throws IOExcept
307308
return root().createRequest().method("GET").withUrlPath(getApiRoute(), "logs").fetchStream(streamFunction);
308309
}
309310

311+
/**
312+
* The actor which triggered the initial run.
313+
*
314+
* @return the triggering actor
315+
*/
316+
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
317+
public GHUser getActor() {
318+
return actor;
319+
}
320+
310321
/**
311322
* The artifacts URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts
312323
*

0 commit comments

Comments
 (0)