Quarkus GitHub Action
Develop your GitHub Actions in Java with Quarkus
Interested in GitHub Apps? Have a look at the Quarkus GitHub App extension.
Quarkus GitHub Action is a Quarkus extension that allows to create GitHub Actions in Java with very little boilerplate.
And yes, it supports generating native executables with GraalVM or Mandrel.
Your GitHub Action will look like:
class MyGitHubAction {
@Action
void doSomething() {
// do something useful here
}
}
Or you can also leverage the GitHub REST API (GraphQL is also supported), get the execution context, get the inputs, produce outputs... with something a bit more involved:
class MyGitHubAction {
@Action
void onIssueOpened(@Issue.Opened GHEventPayload.Issue issuePayload, Context context, Inputs inputs, Outputs outputs) throws IOException {
issuePayload.getIssue().comment("Hello from MyGitHubAction");
outputs.produce("output-key", "the value");
}
}
Quarkus GitHub Action will automatically inject all these fully initialized instances in the @Action
methods for you.
Focus on your business logic and don't bother about the ceremony.
Documentation
To get you started (and more!), please refer to the extensive documentation.
Anything unclear or missing in the documentation? Please open an issue.
How?
The Quarkus GitHub Action extension uses the Hub4j GitHub API to parse the webhook payloads and handle the GitHub REST API calls.
It can also execute GraphQL queries towards the GitHub GraphQL API via the SmallRye GraphQL Client.
The rest of the extension is Quarkus magic - mostly code generation with Gizmo - to get everything wired.
Status
This extension is considered tech preview but should be considered stable very soon.
It relies on the same principles as the Quarkus GitHub App extension, which has been stable for a while.
License
This project is licensed under the Apache License Version 2.0.
✨
Contributors Thanks goes to these wonderful people (emoji key):
Guillaume Smet |
This project follows the all-contributors specification. Contributions of any kind welcome!