Skip to content

Commit f81526b

Browse files
authored
Merge pull request #3 from Ecwid/merge-upstream-1.330-20260721
Merge upstream 1.330
2 parents 61d5596 + 8714140 commit f81526b

20 files changed

Lines changed: 774 additions & 237 deletions

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- [ ] Add JavaDocs and other comments explaining the behavior.
99
- [ ] When adding or updating methods that fetch entities, add `@link` JavaDoc entries to the relevant documentation on https://docs.github.com/en/rest .
1010
- [ ] Add tests that cover any added or changed code. This generally requires capturing snapshot test data. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
11-
- [ ] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI.
11+
- [ ] Run `mvn -D enable-ci clean install site "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"` locally. If this command doesn't succeed, your change will not pass CI.
1212
- [ ] Push your changes to a branch other than `main`. You will create your PR from that branch.
1313

1414
# When creating a PR:

‎.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: 13 additions & 12 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'
@@ -71,9 +71,9 @@ jobs:
7171
os: [ ubuntu, windows ]
7272
java: [ 17, 21 ]
7373
steps:
74-
- uses: actions/checkout@v4
74+
- uses: actions/checkout@v5
7575
- name: Set up JDK
76-
uses: actions/setup-java@v4
76+
uses: actions/setup-java@v5
7777
with:
7878
java-version: ${{ matrix.java }}
7979
distribution: 'temurin'
@@ -98,16 +98,17 @@ jobs:
9898
retention-days: 3
9999
codecov-upload:
100100
name: codecov-upload (Upload to codecov.io)
101+
if: github.repository == 'hub4j/github-api'
101102
needs: test
102103
runs-on: ubuntu-latest
103104
steps:
104-
- uses: actions/checkout@v4
105-
- uses: actions/download-artifact@v4
105+
- uses: actions/checkout@v5
106+
- uses: actions/download-artifact@v5
106107
with:
107108
name: maven-test-target-directory
108109
path: target
109110
- name: Codecov Report
110-
uses: codecov/codecov-action@v5.1.2
111+
uses: codecov/codecov-action@v5.5.0
111112
with:
112113
# Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings
113114
token: ${{ secrets.CODECOV_TOKEN }}
@@ -138,13 +139,13 @@ jobs:
138139
needs: build
139140
runs-on: ubuntu-latest
140141
steps:
141-
- uses: actions/checkout@v4
142-
- uses: actions/download-artifact@v4
142+
- uses: actions/checkout@v5
143+
- uses: actions/download-artifact@v5
143144
with:
144145
name: maven-target-directory
145146
path: target
146147
- name: Set up JDK
147-
uses: actions/setup-java@v4
148+
uses: actions/setup-java@v5
148149
with:
149150
java-version: 11
150151
distribution: 'temurin'

‎.github/workflows/publish_release_branch.yml‎

Lines changed: 8 additions & 8 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'
@@ -55,13 +55,13 @@ jobs:
5555
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
5656
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
5757
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}
58-
58+
5959
publish_gh_pages:
6060
runs-on: ubuntu-latest
6161
needs: build
6262
if: ${{ github.ref == 'refs/heads/release/v2.x' }}
6363
steps:
64-
- uses: actions/checkout@v4
64+
- uses: actions/checkout@v5
6565
with:
6666
fetch-depth: 0
6767

@@ -70,7 +70,7 @@ jobs:
7070
run: |
7171
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
7272
73-
- uses: actions/download-artifact@v4
73+
- uses: actions/download-artifact@v5
7474
with:
7575
name: maven-release-target-directory
7676
path: target
@@ -82,7 +82,7 @@ jobs:
8282
cp -r ./target/site/* ./
8383
8484
- name: Publish GH Pages
85-
uses: stefanzweifel/git-auto-commit-action@v5
85+
uses: stefanzweifel/git-auto-commit-action@v6
8686
with:
8787
commit_message: "Release (${{ github.actor }}): v${{ steps.release.outputs.version }}"
8888
branch: gh-pages

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ target
66
.classpath
77
.project
88
.settings/
9+
.metadata/
910
.DS_Store
1011

1112
dependency-reduced-pom.xml

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Now the new version is available to be used in main project dependencies.
3535
[![codecov](https://codecov.io/gh/hub4j/github-api/branch/main/graph/badge.svg?token=j1jQqydZLJ)](https://codecov.io/gh/hub4j/github-api)
3636

3737

38-
See https://github-api.kohsuke.org/ for more details
38+
See https://hub4j.github.io/github-api/ for more details

‎pom.xml‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.kohsuke</groupId>
44
<artifactId>github-api</artifactId>
5-
<version>1.327-ecwid-12</version>
5+
<version>1.330-ecwid-1</version>
66
<name>GitHub API for Java</name>
77
<url>https://github-api.kohsuke.org/</url>
88
<description>GitHub API for Java</description>
@@ -18,12 +18,12 @@
1818
<snapshotRepository>
1919
<id>sonatype-nexus-snapshots</id>
2020
<name>Sonatype Nexus Snapshots</name>
21-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
21+
<url>${nexus.serverUrl}/content/repositories/snapshots/</url>
2222
</snapshotRepository>
2323
<repository>
2424
<id>sonatype-nexus-staging</id>
2525
<name>Nexus Release Repository</name>
26-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
26+
<url>${nexus.serverUrl}/service/local/staging/deploy/maven2/</url>
2727
</repository>
2828
<site>
2929
<id>github-pages</id>
@@ -49,6 +49,9 @@
4949

5050
<jacoco.surefire.argLine />
5151
<surefire.argLine />
52+
53+
<!-- This project was registered before 2021, so it uses the old server. -->
54+
<nexus.serverUrl>https://ossrh-staging-api.central.sonatype.com</nexus.serverUrl>
5255
</properties>
5356

5457
<build>
@@ -237,7 +240,7 @@
237240
<extensions>true</extensions>
238241
<configuration>
239242
<serverId>sonatype-nexus-staging</serverId>
240-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
243+
<nexusUrl>${nexus.serverUrl}/</nexusUrl>
241244
<autoReleaseAfterClose>true</autoReleaseAfterClose>
242245
</configuration>
243246
</plugin>
@@ -475,7 +478,7 @@
475478
<dependency>
476479
<groupId>com.fasterxml.jackson</groupId>
477480
<artifactId>jackson-bom</artifactId>
478-
<version>2.18.2</version>
481+
<version>2.20.0</version>
479482
<scope>import</scope>
480483
<type>pom</type>
481484
</dependency>
@@ -486,7 +489,7 @@
486489
<dependency>
487490
<groupId>org.apache.commons</groupId>
488491
<artifactId>commons-lang3</artifactId>
489-
<version>3.17.0</version>
492+
<version>3.18.0</version>
490493
</dependency>
491494
<dependency>
492495
<groupId>com.tngtech.archunit</groupId>

‎src/main/java/org/kohsuke/github/GHBranch.java‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,18 @@ public GHBranchProtection getProtection() throws IOException {
111111
return root().createRequest().setRawUrlPath(protection_url).fetch(GHBranchProtection.class);
112112
}
113113

114-
public PagedIterable<GHRule> getRules() throws IOException {
115-
return root().createRequest()
116-
.withUrlPath(owner.getApiTailUrl("rules/branches/" + name))
117-
.toIterable(GHRule[].class, GHRule::wrap);
118-
}
114+
/**
115+
* Lists rules configured for this branch.
116+
*
117+
* @return branch rules
118+
* @throws IOException
119+
* if an I/O error occurs
120+
*/
121+
public PagedIterable<GHRule> getRules() throws IOException {
122+
return root().createRequest()
123+
.withUrlPath(owner.getApiTailUrl("rules/branches/" + name))
124+
.toIterable(GHRule[].class, GHRule::wrap);
125+
}
119126

120127
/**
121128
* Gets sha 1.

‎src/main/java/org/kohsuke/github/GHCommit.java‎

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -350,40 +350,43 @@ public GHRepository getOwner() {
350350
return owner;
351351
}
352352

353-
/**
354-
* Gets commit verification.
355-
* @return
356-
*/
357-
public GHVerification getVerification() {
358-
return commit.getVerification();
359-
}
360-
361-
/**
362-
* Gets commit author.
363-
* @return
364-
*/
365-
public GitUser getCommitAuthor() {
366-
return commit.getAuthor();
367-
}
368-
369-
/**
370-
* Gets commit committer.
371-
* @return
372-
*/
373-
public GitUser getCommitCommitter() {
374-
return commit.getCommitter();
375-
}
376-
377-
/**
378-
* Gets message.
379-
*
380-
* @return the commit message
381-
* @throws IOException
382-
* the io exception
383-
*/
384-
public String getMessage() throws IOException {
385-
return getCommitShortInfo().getMessage();
386-
}
353+
/**
354+
* Gets commit verification.
355+
*
356+
* @return the commit verification
357+
*/
358+
public GHVerification getVerification() {
359+
return commit.getVerification();
360+
}
361+
362+
/**
363+
* Gets commit author.
364+
*
365+
* @return the commit author
366+
*/
367+
public GitUser getCommitAuthor() {
368+
return commit.getAuthor();
369+
}
370+
371+
/**
372+
* Gets commit committer.
373+
*
374+
* @return the commit committer
375+
*/
376+
public GitUser getCommitCommitter() {
377+
return commit.getCommitter();
378+
}
379+
380+
/**
381+
* Gets message.
382+
*
383+
* @return the commit message
384+
* @throws IOException
385+
* the io exception
386+
*/
387+
public String getMessage() throws IOException {
388+
return getCommitShortInfo().getMessage();
389+
}
387390
/**
388391
* Gets lines changed.
389392
*

0 commit comments

Comments
 (0)