Class GithubExtension
java.lang.Object
io.github.intisy.gradle.github.extension.GithubExtension
Extension for configuring GitHub integration.
github {
accessToken = "ghp_..." // or a file/path containing the token
debug = true
skipOnRateLimit = true // skip (don't fail) when a GitHub rate limit is hit
useCli = true // route API calls through the local "gh" CLI
publish {
owner = "my-org"
repo = "my-repo"
version = "2.0.0"
jar = file("build/libs/my-fat.jar")
}
resources {
repoUrl = "https://github.com/my-org/my-resources"
branch = "main"
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisDebug()booleanbooleanisUseCli()voidpublish(groovy.lang.Closure<?> closure) Configures the nested publish extension using a Groovy closure.voidpublish(org.gradle.api.Action<? super PublishExtension> action) Configures the nested publish extension using a Gradle action.voidresources(groovy.lang.Closure<?> closure) Configures the nested resources extension using a Groovy closure.voidresources(org.gradle.api.Action<? super ResourcesExtension> action) Configures the nested resources extension using a Gradle action.voidsetAccessToken(File accessToken) voidsetAccessToken(String accessToken) voidsetAccessToken(Path accessToken) voidsetDebug(boolean debug) voidsetSkipOnRateLimit(boolean skipOnRateLimit) Controls how a GitHub API rate limit is handled.voidsetUseCli(boolean useCli) Controls whether GitHub REST calls are routed through the localghCLI instead of direct HTTP.
-
Constructor Details
-
GithubExtension
public GithubExtension()
-
-
Method Details
-
setDebug
public void setDebug(boolean debug) - Parameters:
debug- Whether to enable debug logging.
-
isDebug
public boolean isDebug()- Returns:
- Whether debug logging is enabled.
-
setSkipOnRateLimit
public void setSkipOnRateLimit(boolean skipOnRateLimit) Controls how a GitHub API rate limit is handled. When enabled, the plugin degrades gracefully instead of failing the build: a rate-limited dependency resolution falls back to the cached (possibly outdated) jar when one exists, and an update check keeps the currently declared version. Only when no cached copy exists is the dependency skipped. Defaults tofalse, which aborts the build on a rate limit.- Parameters:
skipOnRateLimit- whether to degrade gracefully (rather than fail) when the rate limit is hit.
-
isSkipOnRateLimit
public boolean isSkipOnRateLimit()- Returns:
- whether rate-limited operations are skipped instead of failing the build.
-
setUseCli
public void setUseCli(boolean useCli) Controls whether GitHub REST calls are routed through the localghCLI instead of direct HTTP. When enabled, the CLI's own authentication and higher rate limits are used; ifghis not installed the plugin falls back to HTTP. Defaults tofalse.- Parameters:
useCli- whether to use the localghCLI for API calls.
-
isUseCli
public boolean isUseCli()- Returns:
- whether API calls are routed through the local
ghCLI.
-
setAccessToken
- Parameters:
accessToken- The path to the access token.
-
setAccessToken
- Parameters:
accessToken- The file containing the access token.
-
setAccessToken
- Parameters:
accessToken- The access token string.
-
getAccessToken
- Returns:
- The access token.
-
getPublish
- Returns:
- The nested publish extension.
-
publish
Configures the nested publish extension using a Gradle action.- Parameters:
action- The configuration action.
-
publish
public void publish(groovy.lang.Closure<?> closure) Configures the nested publish extension using a Groovy closure. Supports Gradle Groovy DSL usage:publish { ... }- Parameters:
closure- The configuration closure.
-
getResources
- Returns:
- The nested resources extension.
-
resources
Configures the nested resources extension using a Gradle action.- Parameters:
action- The configuration action.
-
resources
public void resources(groovy.lang.Closure<?> closure) Configures the nested resources extension using a Groovy closure. Supports Gradle Groovy DSL usage:resources { ... }- Parameters:
closure- The configuration closure.
-