Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f29f423
Prepare for next development iteration
bitwiseman Feb 13, 2025
9f0314c
Merge pull request #2029 from hub4j/staging/main
bitwiseman Feb 13, 2025
bfade22
Chore(deps): Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.1…
bitwiseman Jul 23, 2025
a9a5f73
Prepare release (bitwiseman): github-api-1.328
bitwiseman Jul 23, 2025
9033e4b
Prepare for next development iteration
bitwiseman Jul 23, 2025
a58b54b
Merge pull request #2117 from hub4j/staging/main
bitwiseman Jul 27, 2025
36c5765
Update ossrh sonatype staging url
bitwiseman Jul 29, 2025
2312260
Update release tag workflow to support 1.x and 2.x
bitwiseman Jul 29, 2025
b33c8ed
Prepare release (bitwiseman): github-api-1.329
bitwiseman Jul 29, 2025
a41abd6
Prepare for next development iteration
bitwiseman Jul 29, 2025
0267bd8
Merge pull request #2118 from hub4j/staging/main-1.x
bitwiseman Jul 29, 2025
e9152d8
Update pom.xml
bitwiseman Jul 29, 2025
a1f3fd5
fix: remove usage of a deprecated constant. (#2138)
bitwiseman Sep 2, 2025
6bf1ad6
Update workflows and readme
bitwiseman Sep 4, 2025
fa40aa3
Prepare release (bitwiseman): github-api-1.330
bitwiseman Sep 4, 2025
730f7f0
Merge upstream github-api-1.330 into fork
ChesterEcwid Jul 21, 2026
5be4615
Apply Spotless formatting
ChesterEcwid Jul 21, 2026
5ee843d
Suppress SpotBugs warnings for GHRule
ChesterEcwid Jul 21, 2026
8266fb3
Fix CI warnings after upstream merge
ChesterEcwid Jul 21, 2026
e8c0220
Register fork classes for AOT
ChesterEcwid Jul 21, 2026
c3ca6cc
Add coverage for fork rule models
ChesterEcwid Jul 21, 2026
8714140
Ignore codecov-upload in forked repo
ChesterEcwid Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [ ] Add JavaDocs and other comments explaining the behavior.
- [ ] When adding or updating methods that fetch entities, add `@link` JavaDoc entries to the relevant documentation on https://docs.github.com/en/rest .
- [ ] Add tests that cover any added or changed code. This generally requires capturing snapshot test data. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
- [ ] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI.
- [ ] 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.
- [ ] Push your changes to a branch other than `main`. You will create your PR from that branch.

# When creating a PR:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:

steps:
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17

- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/create_release_tag_and_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,50 @@ jobs:
create_release_tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Maven Central Repository
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Reset staging/main
- name: Reset staging
id: staging
run: |
git checkout -B staging/main
git push --set-upstream -f origin staging/main
git checkout -B staging/$GITHUB_REF_NAME
git push --set-upstream -f origin staging/$GITHUB_REF_NAME
env:
GITHUB_REF_NAME: ${{ github.ref_name }}

- name: Set Release Version
id: release
run: |
mvn -B versions:set versions:commit -DremoveSnapshot
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT

- uses: stefanzweifel/git-auto-commit-action@v5
- uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
tagging_message: 'github-api-${{ steps.release.outputs.version }}'
branch: staging/main
branch: staging/${{ github.ref_name }}

- name: Increment Snapshot Version
run: |
mvn versions:set versions:commit -DnextSnapshot

- uses: stefanzweifel/git-auto-commit-action@v5
- uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Prepare for next development iteration"
branch: staging/main
branch: staging/${{ github.ref_name }}

- name: pull-request to main
- name: Create pull-request
uses: repo-sync/pull-request@v2
with:
pr_title: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
source_branch: "staging/main"
destination_branch: "main"
source_branch: "staging/${{ github.ref_name }}"
destination_branch: "${{ github.ref_name }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
25 changes: 13 additions & 12 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
Expand All @@ -47,9 +47,9 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
Expand All @@ -71,9 +71,9 @@ jobs:
os: [ ubuntu, windows ]
java: [ 17, 21 ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand All @@ -98,16 +98,17 @@ jobs:
retention-days: 3
codecov-upload:
name: codecov-upload (Upload to codecov.io)
if: github.repository == 'hub4j/github-api'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
with:
name: maven-test-target-directory
path: target
- name: Codecov Report
uses: codecov/codecov-action@v5.1.2
uses: codecov/codecov-action@v5.5.0
with:
# Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -138,13 +139,13 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
with:
name: maven-target-directory
path: target
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: 11
distribution: 'temurin'
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/publish_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -35,9 +35,9 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -55,13 +55,13 @@ jobs:
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}

publish_gh_pages:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/release/v2.x' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -70,7 +70,7 @@ jobs:
run: |
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT

- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
with:
name: maven-release-target-directory
path: target
Expand All @@ -82,7 +82,7 @@ jobs:
cp -r ./target/site/* ./

- name: Publish GH Pages
uses: stefanzweifel/git-auto-commit-action@v5
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Release (${{ github.actor }}): v${{ steps.release.outputs.version }}"
branch: gh-pages
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target
.classpath
.project
.settings/
.metadata/
.DS_Store

dependency-reduced-pom.xml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Now the new version is available to be used in main project dependencies.
[![codecov](https://codecov.io/gh/hub4j/github-api/branch/main/graph/badge.svg?token=j1jQqydZLJ)](https://codecov.io/gh/hub4j/github-api)


See https://github-api.kohsuke.org/ for more details
See https://hub4j.github.io/github-api/ for more details
15 changes: 9 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>1.327-ecwid-12</version>
<version>1.330-ecwid-1</version>
<name>GitHub API for Java</name>
<url>https://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description>
Expand All @@ -18,12 +18,12 @@
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<url>${nexus.serverUrl}/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<url>${nexus.serverUrl}/service/local/staging/deploy/maven2/</url>
</repository>
<site>
<id>github-pages</id>
Expand All @@ -49,6 +49,9 @@

<jacoco.surefire.argLine />
<surefire.argLine />

<!-- This project was registered before 2021, so it uses the old server. -->
<nexus.serverUrl>https://ossrh-staging-api.central.sonatype.com</nexus.serverUrl>
</properties>

<build>
Expand Down Expand Up @@ -237,7 +240,7 @@
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<nexusUrl>${nexus.serverUrl}/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
Expand Down Expand Up @@ -475,7 +478,7 @@
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.18.2</version>
<version>2.20.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand All @@ -486,7 +489,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.17.0</version>
<version>3.18.0</version>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
Expand Down
17 changes: 12 additions & 5 deletions src/main/java/org/kohsuke/github/GHBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,18 @@ public GHBranchProtection getProtection() throws IOException {
return root().createRequest().setRawUrlPath(protection_url).fetch(GHBranchProtection.class);
}

public PagedIterable<GHRule> getRules() throws IOException {
return root().createRequest()
.withUrlPath(owner.getApiTailUrl("rules/branches/" + name))
.toIterable(GHRule[].class, GHRule::wrap);
}
/**
* Lists rules configured for this branch.
*
* @return branch rules
* @throws IOException
* if an I/O error occurs
*/
public PagedIterable<GHRule> getRules() throws IOException {
return root().createRequest()
.withUrlPath(owner.getApiTailUrl("rules/branches/" + name))
.toIterable(GHRule[].class, GHRule::wrap);
}

/**
* Gets sha 1.
Expand Down
71 changes: 37 additions & 34 deletions src/main/java/org/kohsuke/github/GHCommit.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,40 +350,43 @@ public GHRepository getOwner() {
return owner;
}

/**
* Gets commit verification.
* @return
*/
public GHVerification getVerification() {
return commit.getVerification();
}

/**
* Gets commit author.
* @return
*/
public GitUser getCommitAuthor() {
return commit.getAuthor();
}

/**
* Gets commit committer.
* @return
*/
public GitUser getCommitCommitter() {
return commit.getCommitter();
}

/**
* Gets message.
*
* @return the commit message
* @throws IOException
* the io exception
*/
public String getMessage() throws IOException {
return getCommitShortInfo().getMessage();
}
/**
* Gets commit verification.
*
* @return the commit verification
*/
public GHVerification getVerification() {
return commit.getVerification();
}

/**
* Gets commit author.
*
* @return the commit author
*/
public GitUser getCommitAuthor() {
return commit.getAuthor();
}

/**
* Gets commit committer.
*
* @return the commit committer
*/
public GitUser getCommitCommitter() {
return commit.getCommitter();
}

/**
* Gets message.
*
* @return the commit message
* @throws IOException
* the io exception
*/
public String getMessage() throws IOException {
return getCommitShortInfo().getMessage();
}
/**
* Gets lines changed.
*
Expand Down
Loading
Loading