Compare commits
2 Commits
54b5143470
...
ebfc458f30
| Author | SHA1 | Date |
|---|---|---|
|
|
ebfc458f30 | |
|
|
507f216ca0 |
|
|
@ -604,7 +604,7 @@ steps:
|
||||||
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
|
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
|
||||||
* In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
|
* In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
|
||||||
* In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
|
* In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
|
||||||
* (NEW) In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., java=17.0.7-tem) and include the distribution. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
|
* In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., java=17.0.7-tem) and include the distribution. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
|
||||||
|
|
||||||
|
|
||||||
If both `java-version` and `java-version-file` **inputs** are provided, the `java-version` input will be used.
|
If both `java-version` and `java-version-file` **inputs** are provided, the `java-version` input will be used.
|
||||||
|
|
|
||||||
10
src/util.ts
10
src/util.ts
|
|
@ -140,16 +140,16 @@ export function getVersionFromFileContent(
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
const capturedVersion = content.match(javaVersionRegExp)?.groups?.version
|
||||||
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
||||||
: '';
|
: '';
|
||||||
if (!fileContent) {
|
|
||||||
|
core.debug(`Parsed version '${capturedVersion}' from file '${versionFileName}'`);
|
||||||
|
if (!capturedVersion) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(`Version from file '${fileContent}'`);
|
const tentativeVersion = avoidOldNotation(capturedVersion);
|
||||||
|
|
||||||
const tentativeVersion = avoidOldNotation(fileContent);
|
|
||||||
const rawVersion = tentativeVersion.split('-')[0];
|
const rawVersion = tentativeVersion.split('-')[0];
|
||||||
|
|
||||||
let version = semver.validRange(rawVersion)
|
let version = semver.validRange(rawVersion)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue