-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #699 from gsmet/pull_request_target
Add support for pull_request_target (actions only!)
- Loading branch information
Showing
2 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
events/src/main/java/io/quarkiverse/githubapp/event/PullRequestTarget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
package io.quarkiverse.githubapp.event; | ||
|
||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import jakarta.inject.Qualifier; | ||
|
||
import org.kohsuke.github.GHEventPayload; | ||
|
||
@Event(name = "pull_request_target", payload = GHEventPayload.PullRequest.class) | ||
@Target({ PARAMETER, TYPE }) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface PullRequestTarget { | ||
|
||
String value() default Actions.ALL; | ||
|
||
@PullRequestTarget(Assigned.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Assigned { | ||
|
||
String NAME = Actions.ASSIGNED; | ||
} | ||
|
||
@PullRequestTarget(Closed.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Closed { | ||
|
||
String NAME = Actions.CLOSED; | ||
} | ||
|
||
@PullRequestTarget(Edited.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Edited { | ||
|
||
String NAME = Actions.EDITED; | ||
} | ||
|
||
@PullRequestTarget(Labeled.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Labeled { | ||
|
||
String NAME = Actions.LABELED; | ||
} | ||
|
||
@PullRequestTarget(Locked.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Locked { | ||
|
||
String NAME = Actions.LOCKED; | ||
} | ||
|
||
@PullRequestTarget(Opened.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Opened { | ||
|
||
String NAME = Actions.OPENED; | ||
} | ||
|
||
@PullRequestTarget(ReadyForReview.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface ReadyForReview { | ||
|
||
String NAME = Actions.READY_FOR_REVIEW; | ||
} | ||
|
||
@PullRequestTarget(Reopened.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Reopened { | ||
|
||
String NAME = Actions.REOPENED; | ||
} | ||
|
||
@PullRequestTarget(ReviewRequested.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface ReviewRequested { | ||
|
||
String NAME = Actions.REVIEW_REQUESTED; | ||
} | ||
|
||
@PullRequestTarget(ReviewRequestRemoved.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface ReviewRequestRemoved { | ||
|
||
String NAME = Actions.REVIEW_REQUEST_REMOVED; | ||
} | ||
|
||
@PullRequestTarget(Synchronize.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Synchronize { | ||
|
||
String NAME = Actions.SYNCHRONIZE; | ||
} | ||
|
||
@PullRequestTarget(Unassigned.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Unassigned { | ||
|
||
String NAME = Actions.UNASSIGNED; | ||
} | ||
|
||
@PullRequestTarget(Unlabeled.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Unlabeled { | ||
|
||
String NAME = Actions.UNLABELED; | ||
} | ||
|
||
@PullRequestTarget(Unlocked.NAME) | ||
@Target(PARAMETER) | ||
@Retention(RUNTIME) | ||
@Qualifier | ||
public @interface Unlocked { | ||
|
||
String NAME = Actions.UNLOCKED; | ||
} | ||
|
||
} |