Develop your GitHub Actions in Java with Quarkus
Tip
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 MyAction {
@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, execute commands... with something a bit more involved:
class MyAction {
@Action
void onIssueOpened(@Issue.Opened GHEventPayload.Issue issuePayload, Context context, Inputs inputs, Commands commands) throws IOException {
// Add a comment to the issue who triggered the job
issuePayload.getIssue().comment("Hello from MyAction");
// Set the value of an output
commands.setOutput("output-key", "the value");
// Append Markdown to the job summary
commands.appendJobSummary(":wave: Hello from Quarkus GitHub Action");
}
}
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.
Quarkus GitHub Action 2.x is compatible with Quarkus 3.x.
We recommend using the latest versions of both for the best experience.
To get you started (and more!), please refer to the extensive documentation.
Anything unclear or missing in the documentation? Please open an issue, we will address it quickly.
- Conversational Release Action - used to release Quarkus
- Build Reporter Action - used to generate a build report from the Surefire reports and more
- Monitor Artifact Publication Action - used to monitor the publication of a Maven artifact to Maven Central
- Maven Lockfile Action - used to check a project is in line with Maven Lockfile requirements
- Pom to Badges Action - used to generate badges from the dependencies of a project
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.
This extension is considered stable and is used in production.
It relies on the exact same principles as the Quarkus GitHub App extension.
This project is licensed under the Apache License Version 2.0.
Thanks goes to these wonderful people (emoji key):
Guillaume Smet 💻 🚧 |
Jan-Petter Krüger 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!