Skip to content

Commit 1e8ebdb

Browse files
committed
Merge tag 'github-api-2.0-rc.6' into release/v2.x
github-api-2.0-rc.6
2 parents 72b2049 + 7d60c7c commit 1e8ebdb

170 files changed

Lines changed: 23053 additions & 243 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848
java-version: 17
4949

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

5353
# Initializes the CodeQL tools for scanning.
5454
- name: Initialize CodeQL
55-
uses: github/codeql-action/init@v3
55+
uses: github/codeql-action/init@v4
5656
with:
5757
languages: ${{ matrix.language }}
5858
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -63,7 +63,7 @@ jobs:
6363
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6464
# If this step fails, then you should remove it and run the build manually (see below)
6565
- name: Autobuild
66-
uses: github/codeql-action/autobuild@v3
66+
uses: github/codeql-action/autobuild@v4
6767

6868
# ℹ️ Command-line programs to run using the OS shell.
6969
# 📚 https://git.io/JvXDl
@@ -77,4 +77,4 @@ jobs:
7777
# make release
7878

7979
- name: Perform CodeQL Analysis
80-
uses: github/codeql-action/analyze@v3
80+
uses: github/codeql-action/analyze@v4

.github/workflows/create_release_tag_and_pr.yml

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

@@ -35,7 +35,7 @@ jobs:
3535
mvn -B versions:set versions:commit -DremoveSnapshot
3636
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
3737
38-
- uses: stefanzweifel/git-auto-commit-action@v6
38+
- uses: stefanzweifel/git-auto-commit-action@v7
3939
with:
4040
commit_message: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
4141
tagging_message: 'github-api-${{ steps.release.outputs.version }}'
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
mvn versions:set versions:commit -DnextSnapshot
4747
48-
- uses: stefanzweifel/git-auto-commit-action@v6
48+
- uses: stefanzweifel/git-auto-commit-action@v7
4949
with:
5050
commit_message: "Prepare for next development iteration"
5151
branch: staging/${{ github.ref_name }}

.github/workflows/maven-build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: true
2727
steps:
28-
- uses: actions/checkout@v5
28+
- uses: actions/checkout@v6
2929
- name: Set up JDK
3030
uses: actions/setup-java@v5
3131
with:
@@ -36,7 +36,7 @@ jobs:
3636
env:
3737
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
3838
run: mvn -B clean install -DskipTests --file pom.xml
39-
- uses: actions/upload-artifact@v4
39+
- uses: actions/upload-artifact@v7
4040
with:
4141
name: maven-target-directory
4242
path: target/
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
fail-fast: false
4949
steps:
50-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
5151
- name: Set up JDK
5252
uses: actions/setup-java@v5
5353
with:
@@ -68,7 +68,7 @@ jobs:
6868
strategy:
6969
fail-fast: true
7070
steps:
71-
- uses: actions/checkout@v5
71+
- uses: actions/checkout@v6
7272
- name: Set up JDK
7373
uses: actions/setup-java@v5
7474
with:
@@ -90,7 +90,7 @@ jobs:
9090
os: [ ubuntu, windows ]
9191
java: [ 17, 21 ]
9292
steps:
93-
- uses: actions/checkout@v5
93+
- uses: actions/checkout@v6
9494
- name: Set up JDK
9595
uses: actions/setup-java@v5
9696
with:
@@ -110,7 +110,7 @@ jobs:
110110
run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
111111
- name: Save coverage data
112112
if: matrix.os == 'ubuntu' && matrix.java == '17'
113-
uses: actions/upload-artifact@v4
113+
uses: actions/upload-artifact@v7
114114
with:
115115
name: maven-test-target-directory
116116
path: target/
@@ -120,13 +120,13 @@ jobs:
120120
needs: test
121121
runs-on: ubuntu-latest
122122
steps:
123-
- uses: actions/checkout@v5
124-
- uses: actions/download-artifact@v5
123+
- uses: actions/checkout@v6
124+
- uses: actions/download-artifact@v8
125125
with:
126126
name: maven-test-target-directory
127127
path: target
128128
- name: Codecov Report
129-
uses: codecov/codecov-action@v5.5.0
129+
uses: codecov/codecov-action@v6.0.0
130130
with:
131131
# Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings
132132
token: ${{ secrets.CODECOV_TOKEN }}
@@ -138,8 +138,8 @@ jobs:
138138
needs: build
139139
runs-on: ubuntu-latest
140140
steps:
141-
- uses: actions/checkout@v5
142-
- uses: actions/download-artifact@v5
141+
- uses: actions/checkout@v6
142+
- uses: actions/download-artifact@v8
143143
with:
144144
name: maven-target-directory
145145
path: target

.github/workflows/publish_release_branch.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v5
15+
- uses: actions/checkout@v6
1616
- name: Set up Maven Central Repository
1717
uses: actions/setup-java@v5
1818
with:
@@ -25,7 +25,7 @@ jobs:
2525
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
2626
run: mvn -B clean install site -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
2727

28-
- uses: actions/upload-artifact@v4
28+
- uses: actions/upload-artifact@v7
2929
with:
3030
name: maven-release-target-directory
3131
path: target/
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ubuntu-latest
3636
needs: build
3737
steps:
38-
- uses: actions/checkout@v5
38+
- uses: actions/checkout@v6
3939
- name: Set up Maven Central Repository
4040
uses: actions/setup-java@v5
4141
with:
@@ -69,7 +69,7 @@ jobs:
6969
needs: build
7070
if: ${{ github.ref == 'refs/heads/release/v2.x' }}
7171
steps:
72-
- uses: actions/checkout@v5
72+
- uses: actions/checkout@v6
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@v5
81+
- uses: actions/download-artifact@v8
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@v6
93+
uses: stefanzweifel/git-auto-commit-action@v7
9494
with:
9595
commit_message: "Release (${{ github.actor }}): v${{ steps.release.outputs.version }}"
9696
branch: gh-pages

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Release Drafter
20-
uses: release-drafter/release-drafter@v6
20+
uses: release-drafter/release-drafter@v7
2121
env:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pom.xml

Lines changed: 13 additions & 13 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.5</version>
6+
<version>2.0-rc.6</version>
77
<name>GitHub API for Java</name>
88
<description>GitHub API for Java</description>
99
<url>https://hub4j.github.io/github-api/</url>
@@ -71,16 +71,16 @@
7171
<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
7272

7373
<jacoco.surefire.argLine></jacoco.surefire.argLine>
74-
<jjwt.suite.version>0.12.6</jjwt.suite.version>
74+
<jjwt.suite.version>0.13.0</jjwt.suite.version>
7575
<!-- This project was registered before 2021, so it uses the old server. -->
7676
<nexus.serverUrl>https://ossrh-staging-api.central.sonatype.com</nexus.serverUrl>
7777
<okhttp3.version>4.12.0</okhttp3.version>
7878
<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>
81-
<spotbugs-maven-plugin.version>4.9.3.0</spotbugs-maven-plugin.version>
81+
<spotbugs-maven-plugin.version>4.9.8.2</spotbugs-maven-plugin.version>
8282
<spotbugs.version>4.8.6</spotbugs.version>
83-
<spring.boot.version>3.3.5</spring.boot.version>
83+
<spring.boot.version>3.4.5</spring.boot.version>
8484
<surefire.argLine></surefire.argLine>
8585
</properties>
8686

@@ -89,7 +89,7 @@
8989
<dependency>
9090
<groupId>com.fasterxml.jackson</groupId>
9191
<artifactId>jackson-bom</artifactId>
92-
<version>2.20.0</version>
92+
<version>2.21.0</version>
9393
<type>pom</type>
9494
<scope>import</scope>
9595
</dependency>
@@ -194,7 +194,7 @@
194194
<dependency>
195195
<groupId>org.apache.commons</groupId>
196196
<artifactId>commons-lang3</artifactId>
197-
<version>3.18.0</version>
197+
<version>3.19.0</version>
198198
</dependency>
199199
<dependency>
200200
<groupId>com.github.npathai</groupId>
@@ -211,7 +211,7 @@
211211
<dependency>
212212
<groupId>com.google.code.gson</groupId>
213213
<artifactId>gson</artifactId>
214-
<version>2.12.1</version>
214+
<version>2.13.2</version>
215215
<scope>test</scope>
216216
</dependency>
217217
<dependency>
@@ -268,7 +268,7 @@
268268
<dependency>
269269
<groupId>org.mockito</groupId>
270270
<artifactId>mockito-core</artifactId>
271-
<version>5.16.1</version>
271+
<version>5.21.0</version>
272272
<scope>test</scope>
273273
</dependency>
274274
<!--
@@ -320,7 +320,7 @@
320320
<plugin>
321321
<groupId>org.apache.maven.plugins</groupId>
322322
<artifactId>maven-gpg-plugin</artifactId>
323-
<version>3.2.7</version>
323+
<version>3.2.8</version>
324324
</plugin>
325325
<plugin>
326326
<groupId>org.apache.maven.plugins</groupId>
@@ -330,7 +330,7 @@
330330
<plugin>
331331
<groupId>org.apache.maven.plugins</groupId>
332332
<artifactId>maven-javadoc-plugin</artifactId>
333-
<version>3.11.2</version>
333+
<version>3.12.0</version>
334334
<configuration>
335335
<source>11</source>
336336
<release>11</release>
@@ -348,7 +348,7 @@
348348
</plugin>
349349
<plugin>
350350
<artifactId>maven-surefire-plugin</artifactId>
351-
<version>3.5.3</version>
351+
<version>3.5.5</version>
352352
<configuration>
353353
<!-- SUREFIRE-1226 workaround -->
354354
<trimStackTrace>false</trimStackTrace>
@@ -362,7 +362,7 @@
362362
<plugin>
363363
<groupId>org.jacoco</groupId>
364364
<artifactId>jacoco-maven-plugin</artifactId>
365-
<version>0.8.13</version>
365+
<version>0.8.14</version>
366366
<configuration>
367367
<!-- no need to get data about external code. It dramatically reduces performance of JaCoCo for nothing -->
368368
<excludes>
@@ -619,7 +619,7 @@
619619
<dependency>
620620
<groupId>org.apache.bcel</groupId>
621621
<artifactId>bcel</artifactId>
622-
<version>6.10.0</version>
622+
<version>6.12.0</version>
623623
</dependency>
624624
</dependencies>
625625
</plugin>

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,34 @@ static String getApiRoute(GHRepository repository, String path) {
5656
public GHContent() {
5757
}
5858

59+
/**
60+
* Creates a builder that can be used to delete this file.
61+
*
62+
* <p>
63+
* Unlike the {@link #delete(String)} convenience methods, this builder supports setting the author and committer of
64+
* the resulting commit.
65+
*
66+
* @return a content deleter
67+
* @see GHContentDeleter
68+
*/
69+
public GHContentDeleter createDelete() {
70+
return new GHContentDeleter(this);
71+
}
72+
73+
/**
74+
* Creates a builder that can be used to update this file's content.
75+
*
76+
* <p>
77+
* Unlike the {@link #update(String, String)} convenience methods, this builder supports setting the author and
78+
* committer of the resulting commit.
79+
*
80+
* @return a content updater
81+
* @see GHContentUpdater
82+
*/
83+
public GHContentUpdater createUpdate() {
84+
return new GHContentUpdater(this);
85+
}
86+
5987
/**
6088
* Delete gh content update response.
6189
*

0 commit comments

Comments
 (0)