Skip to content

Commit e4c66ad

Browse files
committed
Merge branch 'main' into Issue-576-collaborator-by-username
2 parents 844cb0f + 49d9ce2 commit e4c66ad

File tree

147 files changed

+7575
-1255
lines changed

Some content is hidden

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

147 files changed

+7575
-1255
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ on:
2020
schedule:
2121
- cron: '20 0 * * 6'
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
analyze:
28+
permissions:
29+
actions: read # for github/codeql-action/init to get workflow details
30+
contents: read # for actions/checkout to fetch code
31+
security-events: write # for github/codeql-action/autobuild to send a status report
2532
name: Analyze
2633
runs-on: ubuntu-latest
2734

@@ -39,7 +46,7 @@ jobs:
3946

4047
# Initializes the CodeQL tools for scanning.
4148
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
49+
uses: github/codeql-action/init@v2
4350
with:
4451
languages: ${{ matrix.language }}
4552
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +57,7 @@ jobs:
5057
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5158
# If this step fails, then you should remove it and run the build manually (see below)
5259
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
60+
uses: github/codeql-action/autobuild@v2
5461

5562
# ℹ️ Command-line programs to run using the OS shell.
5663
# 📚 https://git.io/JvXDl
@@ -64,4 +71,4 @@ jobs:
6471
# make release
6572

6673
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
74+
uses: github/codeql-action/analyze@v2

.github/workflows/maven-build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
env:
1515
JAVA_11_PLUS_MAVEN_OPTS: "--add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build:
1922
name: build-only (Java ${{ matrix.java }})
@@ -71,15 +74,15 @@ jobs:
7174
- name: Maven Install with Code Coverage
7275
run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml
7376
- name: Codecov Report
74-
uses: codecov/codecov-action@v3.0.0
77+
uses: codecov/codecov-action@v3.1.0
7578
test:
7679
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
7780
runs-on: ${{ matrix.os }}-latest
7881
strategy:
7982
fail-fast: false
8083
matrix:
8184
os: [ ubuntu, windows ]
82-
java: [ 11.0.3, 11, 17 ]
85+
java: [ 11, 17 ]
8386
steps:
8487
- uses: actions/checkout@v3
8588
- name: Set up JDK

.github/workflows/release-drafter.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
update_release_draft:
14+
permissions:
15+
contents: write # for release-drafter/release-drafter to create a github release
16+
pull-requests: write # for release-drafter/release-drafter to add label to PR
1117
runs-on: ubuntu-latest
1218
steps:
1319
- name: Release Drafter

pom.xml

Lines changed: 13 additions & 13 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.304-SNAPSHOT</version>
5+
<version>1.307-SNAPSHOT</version>
66
<name>GitHub API for Java</name>
77
<url>https://github-api.kohsuke.org/</url>
88
<description>GitHub API for Java</description>
@@ -33,7 +33,7 @@
3333

3434
<properties>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36-
<spotbugs-maven-plugin.version>4.6.0.0</spotbugs-maven-plugin.version>
36+
<spotbugs-maven-plugin.version>4.7.0.0</spotbugs-maven-plugin.version>
3737
<spotbugs.version>4.6.0</spotbugs.version>
3838
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
3939
<hamcrest.version>2.2</hamcrest.version>
@@ -44,7 +44,7 @@
4444
<jacoco.coverage.target.class.method>0.50</jacoco.coverage.target.class.method>
4545
<!-- For non-ci builds we'd like the build to still complete if jacoco metrics aren't met. -->
4646
<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
47-
<jjwt.suite.version>0.11.2</jjwt.suite.version>
47+
<jjwt.suite.version>0.11.5</jjwt.suite.version>
4848

4949
<jacoco.surefire.argLine />
5050
<surefire.argLine />
@@ -55,12 +55,12 @@
5555
<extension>
5656
<groupId>org.apache.maven.scm</groupId>
5757
<artifactId>maven-scm-provider-gitexe</artifactId>
58-
<version>1.12.2</version>
58+
<version>1.13.0</version>
5959
</extension>
6060
<extension>
6161
<groupId>org.apache.maven.scm</groupId>
6262
<artifactId>maven-scm-manager-plexus</artifactId>
63-
<version>1.12.2</version>
63+
<version>1.13.0</version>
6464
</extension>
6565
<!-- Doing site publishing manually for now -->
6666
<!--
@@ -213,7 +213,7 @@
213213
<plugin>
214214
<groupId>org.apache.maven.plugins</groupId>
215215
<artifactId>maven-javadoc-plugin</artifactId>
216-
<version>3.3.2</version>
216+
<version>3.4.0</version>
217217
<configuration>
218218
<source>8</source>
219219
<failOnWarnings>true</failOnWarnings>
@@ -223,7 +223,7 @@
223223
<plugin>
224224
<groupId>org.sonatype.plugins</groupId>
225225
<artifactId>nexus-staging-maven-plugin</artifactId>
226-
<version>1.6.12</version>
226+
<version>1.6.13</version>
227227
<extensions>true</extensions>
228228
<configuration>
229229
<serverId>sonatype-nexus-staging</serverId>
@@ -258,7 +258,7 @@
258258
<plugin>
259259
<groupId>org.apache.maven.plugins</groupId>
260260
<artifactId>maven-site-plugin</artifactId>
261-
<version>3.11.0</version>
261+
<version>3.12.0</version>
262262
</plugin>
263263
<plugin>
264264
<groupId>org.apache.maven.plugins</groupId>
@@ -278,7 +278,7 @@
278278
<plugin>
279279
<groupId>org.apache.maven.plugins</groupId>
280280
<artifactId>maven-project-info-reports-plugin</artifactId>
281-
<version>3.2.2</version>
281+
<version>3.3.0</version>
282282
<dependencies>
283283
<dependency>
284284
<groupId>org.apache.bcel</groupId>
@@ -333,7 +333,7 @@
333333
<plugin>
334334
<groupId>com.diffplug.spotless</groupId>
335335
<artifactId>spotless-maven-plugin</artifactId>
336-
<version>2.22.1</version>
336+
<version>2.22.8</version>
337337
<executions>
338338
<execution>
339339
<id>spotless-check</id>
@@ -468,7 +468,7 @@
468468
<dependency>
469469
<groupId>com.fasterxml.jackson.core</groupId>
470470
<artifactId>jackson-databind</artifactId>
471-
<version>2.13.2.2</version>
471+
<version>2.13.3</version>
472472
</dependency>
473473
<dependency>
474474
<groupId>commons-io</groupId>
@@ -567,7 +567,7 @@
567567
<dependency>
568568
<groupId>org.mockito</groupId>
569569
<artifactId>mockito-core</artifactId>
570-
<version>4.4.0</version>
570+
<version>4.6.1</version>
571571
<scope>test</scope>
572572
</dependency>
573573
<dependency>
@@ -698,7 +698,7 @@
698698
<plugin>
699699
<groupId>org.apache.maven.plugins</groupId>
700700
<artifactId>maven-enforcer-plugin</artifactId>
701-
<version>3.0.0</version>
701+
<version>3.1.0</version>
702702
<executions>
703703
<execution>
704704
<id>enforce-jacoco-exist</id>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public URL getHtmlUrl() throws IOException {
9999
* the io exception
100100
*/
101101
public void delete() throws IOException {
102-
root().createRequest().method("DELETE").withUrlPath(getApiRoute()).fetchHttpStatusCode();
102+
root().createRequest().method("DELETE").withUrlPath(getApiRoute()).send();
103103
}
104104

105105
/**

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,43 @@ void lateBind() {
15061506
}
15071507
}
15081508

1509+
/**
1510+
* A workflow job has been queued, is in progress, or has been completed.
1511+
*
1512+
* @see <a href=
1513+
* "https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job">
1514+
* workflow job event</a>
1515+
* @see <a href="https://docs.github.com/en/rest/reference/actions#workflow-jobs">Actions Workflow Jobs</a>
1516+
*/
1517+
public static class WorkflowJob extends GHEventPayload {
1518+
1519+
private GHWorkflowJob workflowJob;
1520+
1521+
/**
1522+
* Gets the workflow job.
1523+
*
1524+
* @return the workflow job
1525+
*/
1526+
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
1527+
public GHWorkflowJob getWorkflowJob() {
1528+
return workflowJob;
1529+
}
1530+
1531+
@Override
1532+
void lateBind() {
1533+
if (workflowJob == null) {
1534+
throw new IllegalStateException(
1535+
"Expected workflow_job payload, but got something else. Maybe we've got another type of event?");
1536+
}
1537+
super.lateBind();
1538+
GHRepository repository = getRepository();
1539+
if (repository == null) {
1540+
throw new IllegalStateException("Repository must not be null");
1541+
}
1542+
workflowJob.wrapUp(repository);
1543+
}
1544+
}
1545+
15091546
/**
15101547
* A label was created, edited or deleted.
15111548
*
@@ -1572,4 +1609,25 @@ public GHLabel getLabel() {
15721609
return label;
15731610
}
15741611
}
1612+
1613+
/**
1614+
* A star was created or deleted on a repository.
1615+
*
1616+
* @see <a href=
1617+
* "https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#star">star
1618+
* event</a>
1619+
*/
1620+
public static class Star extends GHEventPayload {
1621+
1622+
private String starredAt;
1623+
1624+
/**
1625+
* Gets the date when the star is added. Is null when the star is deleted.
1626+
*
1627+
* @return the date when the star is added
1628+
*/
1629+
public Date getStarredAt() {
1630+
return GitHubClient.parseDate(starredAt);
1631+
}
1632+
}
15751633
}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,20 @@
66
* @author Kohsuke Kawaguchi
77
*/
88
public enum GHPermissionType {
9-
ADMIN, WRITE, READ, NONE
9+
ADMIN(30), WRITE(20), READ(10), NONE(0);
10+
11+
private final int level;
12+
13+
GHPermissionType(int level) {
14+
this.level = level;
15+
}
16+
17+
boolean implies(GHPermissionType other) {
18+
// NONE is a special case
19+
if (other == NONE) {
20+
return this == NONE;
21+
}
22+
23+
return this.level >= other.level;
24+
}
1025
}

0 commit comments

Comments
 (0)