Enum Class CredentialProviders
java.lang.Object
java.lang.Enum<CredentialProviders>
io.github.duckasteroid.gradle.githubpackages.CredentialProviders
- All Implemented Interfaces:
Serializable,Comparable<CredentialProviders>,Constable,Function<org.gradle.api.provider.ProviderFactory,org.gradle.api.provider.Provider<String>>
public enum CredentialProviders
extends Enum<CredentialProviders>
implements Function<org.gradle.api.provider.ProviderFactory,org.gradle.api.provider.Provider<String>>
Provides standardised routes to get the authentication credentials for GitHub Packages.
Uses a three-tier fallback chain:
- Tier 1 (Gradle Properties): gpr.user / gpr.key from gradle.properties
- Tier 2 (GitHub Actions): GITHUB_ACTOR / GITHUB_TOKEN environment variables
- Tier 3 (Read-Only): GH_PACKAGES_READ_USER / GH_PACKAGES_READ_TOKEN environment variables
The first available source in this chain is used. Once a value is found at any tier, lower tiers are not consulted.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic CredentialProvidersReturns the enum constant of this class with the specified name.static CredentialProviders[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
USER
Resolves the GitHub username for authentication. The search path is:- Gradle property:
gpr.user - Environment variable:
GITHUB_ACTOR - Environment variable:
GH_PACKAGES_READ_USER
- Gradle property:
-
TOKEN
Resolves the GitHub token for authentication. The search path is:- Gradle property:
gpr.key - Environment variable:
GITHUB_TOKEN - Environment variable:
GH_PACKAGES_READ_TOKEN
- Gradle property:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-