-
Notifications
You must be signed in to change notification settings - Fork 833
feat: Add support for .sdkmanrc file in java-version-file parameter
#736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking "Sign up for GitHub", you agree to our terms of service and privacy statement. We'll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
HarithaVattikuti
merged 13 commits into
actions:main
from
guicamest:feat/669/support_sdkmanrc
Nov 25, 2025
Merged
feat: Add support for .sdkmanrc file in java-version-file parameter
#736
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b185b99
chore(e2e-versions): Add e2e test scenario on `setup-java-version-fro...
guicamest 47407b3
chore(e2e-versions): Update `setup-java-version-from-file-major-minor...
guicamest 556a113
feat: Add support for `.sdkmanrc` as *Java Version File*
guicamest 3228b7f
chore: Add test for the latest known sdkman java versions
guicamest b38bd61
docs(advanced-usage): Document support for `.sdkmanrc` as java-versio...
guicamest dd4a6bd
chore(docs): Anyone can contribute and maintain :shrug:
guicamest 54b5143
Update advanced-usage.md
guicamest 507f216
Update advanced-usage.md
guicamest ebfc458
Update util.ts
guicamest d6f9a13
chore: format and rebuild
guicamest 95f21d2
Merge branch 'actions:main' into feat/669/support_sdkmanrc
guicamest a985bcf
chore: untouch toolchains.ts
guicamest 73b943d
fix check dist error
mahabaleshwars File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -490,14 +490,14 @@ jobs: | |
| shell: bash | ||
|
|
||
| setup-java-version-from-file-major-minor-patch-with-dist: | ||
| name: ${{ matrix.distribution }} version from file 'openjdk64-17.0.10' - ${{ matrix.os }} | ||
| name: ${{ matrix.distribution }} version from file '${{ matrix.java-version-file }}' - ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| distribution: ['adopt', 'zulu', 'liberica'] | ||
| java-version-file: ['.java-version', '.tool-versions'] | ||
| java-version-file: ['.java-version', '.tool-versions', '.sdkmanrc'] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
@@ -507,6 +507,9 @@ jobs: | |
| - name: Create .tool-versions file | ||
| shell: bash | ||
| run: echo "java openjdk64-17.0.10" > .tool-versions | ||
| - name: Create .sdkmanrc file | ||
| shell: bash | ||
| run: echo "java=17.0.10-tem" > .sdkmanrc | ||
| - name: setup-java | ||
| uses: ./ | ||
| id: setup-java | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| 6.0.119-zulu, 6.0.119 | ||
| 7.0.352-zulu, 7.0.352 | ||
| 8.0.282-trava, 8.0.282 | ||
| 8.0.432-albba, 8.0.432 | ||
| 8.0.432-amzn, 8.0.432 | ||
| 8.0.432-kona, 8.0.432 | ||
| 8.0.432-librca, 8.0.432 | ||
| 8.0.432-sem, 8.0.432 | ||
| 8.0.432-tem, 8.0.432 | ||
| 8.0.432-zulu, 8.0.432 | ||
| 8.0.432.fx-librca, 8.0.432 | ||
| 8.0.432.fx-zulu, 8.0.432 | ||
| 8.0.442-amzn, 8.0.442 | ||
| 8.0.442-librca, 8.0.442 | ||
| 8.0.442-tem, 8.0.442 | ||
| 8.0.442-zulu, 8.0.442 | ||
| 8.0.442.fx-librca, 8.0.442 | ||
| 8.0.442.fx-zulu, 8.0.442 | ||
| 11.0.14.1-jbr, 11.0.14 | ||
| 11.0.15-trava, 11.0.15 | ||
| 11.0.25-albba, 11.0.25 | ||
| 11.0.25-amzn, 11.0.25 | ||
| 11.0.25-kona, 11.0.25 | ||
| 11.0.25-librca, 11.0.25 | ||
| 11.0.25-ms, 11.0.25 | ||
| 11.0.25-sapmchn, 11.0.25 | ||
| 11.0.25-sem, 11.0.25 | ||
| 11.0.25-tem, 11.0.25 | ||
| 11.0.25-zulu, 11.0.25 | ||
| 11.0.25.fx-librca, 11.0.25 | ||
| 11.0.25.fx-zulu, 11.0.25 | ||
| 11.0.26-amzn, 11.0.26 | ||
| 11.0.26-librca, 11.0.26 | ||
| 11.0.26-ms, 11.0.26 | ||
| 11.0.26-sapmchn, 11.0.26 | ||
| 11.0.26-zulu, 11.0.26 | ||
| 11.0.26.fx-librca, 11.0.26 | ||
| 11.0.26.fx-zulu, 11.0.26 | ||
| 17.0.12-graal, 17.0.12 | ||
| 17.0.12-jbr, 17.0.12 | ||
| 17.0.12-oracle, 17.0.12 | ||
| 17.0.13-albba, 17.0.13 | ||
| 17.0.13-amzn, 17.0.13 | ||
| 17.0.13-kona, 17.0.13 | ||
| 17.0.13-librca, 17.0.13 | ||
| 17.0.13-ms, 17.0.13 | ||
| 17.0.13-sapmchn, 17.0.13 | ||
| 17.0.13-sem, 17.0.13 | ||
| 17.0.13-tem, 17.0.13 | ||
| 17.0.13-zulu, 17.0.13 | ||
| 17.0.13.crac-librca, 17.0.13 | ||
| 17.0.13.crac-zulu, 17.0.13 | ||
| 17.0.13.fx-librca, 17.0.13 | ||
| 17.0.13.fx-zulu, 17.0.13 | ||
| 17.0.14-amzn, 17.0.14 | ||
| 17.0.14-librca, 17.0.14 | ||
| 17.0.14-ms, 17.0.14 | ||
| 17.0.14-sapmchn, 17.0.14 | ||
| 17.0.14-zulu, 17.0.14 | ||
| 17.0.14.fx-librca, 17.0.14 | ||
| 17.0.14.fx-zulu, 17.0.14 | ||
| 17.0.9-graalce, 17.0.9 | ||
| 21.0.2-graalce, 21.0.2 | ||
| 21.0.2-open, 21.0.2 | ||
| 21.0.5-amzn, 21.0.5 | ||
| 21.0.5-graal, 21.0.5 | ||
| 21.0.5-jbr, 21.0.5 | ||
| 21.0.5-kona, 21.0.5 | ||
| 21.0.5-librca, 21.0.5 | ||
| 21.0.5-ms, 21.0.5 | ||
| 21.0.5-oracle, 21.0.5 | ||
| 21.0.5-sapmchn, 21.0.5 | ||
| 21.0.5-sem, 21.0.5 | ||
| 21.0.5-tem, 21.0.5 | ||
| 21.0.5-zulu, 21.0.5 | ||
| 21.0.5.crac-librca, 21.0.5 | ||
| 21.0.5.crac-zulu, 21.0.5 | ||
| 21.0.5.fx-librca, 21.0.5 | ||
| 21.0.5.fx-zulu, 21.0.5 | ||
| 21.0.6-amzn, 21.0.6 | ||
| 21.0.6-graal, 21.0.6 | ||
| 21.0.6-librca, 21.0.6 | ||
| 21.0.6-ms, 21.0.6 | ||
| 21.0.6-oracle, 21.0.6 | ||
| 21.0.6-sapmchn, 21.0.6 | ||
| 21.0.6-tem, 21.0.6 | ||
| 21.0.6-zulu, 21.0.6 | ||
| 21.0.6.fx-librca, 21.0.6 | ||
| 21.0.6.fx-zulu, 21.0.6 | ||
| 22.0.2-oracle, 22.0.2 | ||
| 22.1.0.1.r11-gln, 22.1.0 | ||
| 22.1.0.1.r17-gln, 22.1.0 | ||
| 22.3.5.r11-nik, 22.3.5 | ||
| 22.3.5.r17-mandrel, 22.3.5 | ||
| 22.3.5.r17-nik, 22.3.5 | ||
| 23-open, 23 | ||
| 23.0.1-amzn, 23.0.1 | ||
| 23.0.1-graal, 23.0.1 | ||
| 23.0.1-graalce, 23.0.1 | ||
| 23.0.1-librca, 23.0.1 | ||
| 23.0.1-open, 23.0.1 | ||
| 23.0.1-oracle, 23.0.1 | ||
| 23.0.1-sapmchn, 23.0.1 | ||
| 23.0.1-tem, 23.0.1 | ||
| 23.0.1-zulu, 23.0.1 | ||
| 23.0.1.crac-zulu, 23.0.1 | ||
| 23.0.1.fx-librca, 23.0.1 | ||
| 23.0.1.fx-zulu, 23.0.1 | ||
| 23.0.2-amzn, 23.0.2 | ||
| 23.0.2-graal, 23.0.2 | ||
| 23.0.2-graalce, 23.0.2 | ||
| 23.0.2-librca, 23.0.2 | ||
| 23.0.2-oracle, 23.0.2 | ||
| 23.0.2-sapmchn, 23.0.2 | ||
| 23.0.2-tem, 23.0.2 | ||
| 23.0.2-zulu, 23.0.2 | ||
| 23.0.2.fx-librca, 23.0.2 | ||
| 23.0.2.fx-zulu, 23.0.2 | ||
| 23.0.6.fx-nik, 23.0.6 | ||
| 23.0.6.r17-mandrel, 23.0.6 | ||
| 23.0.6.r17-nik, 23.0.6 | ||
| 23.1.5.fx-nik, 23.1.5 | ||
| 23.1.5.r21-mandrel, 23.1.5 | ||
| 23.1.5.r21-nik, 23.1.5 | ||
| 24.0.2.r22-mandrel, 24.0.2 | ||
| 24.ea.27-graal, 24.0.0 | ||
| 24.ea.28-graal, 24.0.0 | ||
| 24.ea.31-open, 24.0.0 | ||
| 24.ea.32-open, 24.0.0 | ||
| 24.1.1.r23-mandrel, 24.1.1 | ||
| 24.1.1.r23-nik, 24.1.1 | ||
| 25.ea.4-graal, 25.0.0 | ||
| 25.ea.5-graal, 25.0.0 | ||
| 25.ea.5-open, 25.0.0 | ||
| 25.ea.6-open, 25.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| import * as cache from '@actions/cache'; | ||
| import * as core from '@actions/core'; | ||
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
| import { | ||
| convertVersionToSemver, | ||
| getVersionFromFileContent, | ||
| isVersionSatisfies, | ||
| isCacheFeatureAvailable, | ||
| isGhes | ||
|
|
@@ -82,6 +85,43 @@ describe('convertVersionToSemver', () => { | |
| }); | ||
| }); | ||
|
|
||
| describe('getVersionFromFileContent', () => { | ||
| describe('.sdkmanrc', () => { | ||
| it.each([ | ||
| ['java=11.0.20.1-tem', '11.0.20'], | ||
| ['java = 11.0.20.1-tem', '11.0.20'], | ||
| ['java=11.0.20.1-tem # a comment in sdkmanrc', '11.0.20'], | ||
| ['java=11.0.20.1-tem\n#java=21.0.20.1-tem\n', '11.0.20'], // choose first match | ||
| ['java=11.0.20.1-tem\njava=21.0.20.1-tem\n', '11.0.20'], // choose first match | ||
| ['#java=11.0.20.1-tem\njava=21.0.20.1-tem\n', '21.0.20'] // first one is 'commented' in .sdkmanrc | ||
| ])('parsing %s should return %s', (content: string, expected: string) => { | ||
| const actual = getVersionFromFileContent(content, 'openjdk', '.sdkmanrc'); | ||
| expect(actual).toBe(expected); | ||
| }); | ||
|
|
||
| describe('known versions', () => { | ||
| const csv = fs.readFileSync( | ||
| path.join(__dirname, 'data/sdkman-java-versions.csv'), | ||
| 'utf8' | ||
| ); | ||
| const versions = csv.split('\n').map(r => r.split(', ')); | ||
|
|
||
| it.each(versions)( | ||
| 'parsing %s should return %s', | ||
| (sdkmanJavaVersion: string, expected: string) => { | ||
| const asContent = `java=${sdkmanJavaVersion}`; | ||
| const actual = getVersionFromFileContent( | ||
| asContent, | ||
| 'openjdk', | ||
| '.sdkmanrc' | ||
| ); | ||
| expect(actual).toBe(expected); | ||
| } | ||
| ); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
| describe('isGhes', () => { | ||
| const pristineEnv = process.env; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94706,17 +94706,20 @@ function getVersionFromFileContent(content, distributionName, versionFile) { | |
| javaVersionRegExp = | ||
|
/^java\s+(?:\S*-)?(? |
||
| } | ||
| else if (versionFileName == '.sdkmanrc') { | ||
|
javaVersionRegExp = /^java\s*=\s*(? |
||
| } | ||
| else { | ||
|
javaVersionRegExp = /(? |
||
| } | ||
| const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version) | ||
| const capturedVersion = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version) | ||
| ? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version | ||
| : ''; | ||
| if (!fileContent) { | ||
| core.debug(`Parsed version '${capturedVersion}' from file '${versionFileName}'`); | ||
| if (!capturedVersion) { | ||
| return null; | ||
| } | ||
| core.debug(`Version from file '${fileContent}'`); | ||
| const tentativeVersion = avoidOldNotation(fileContent); | ||
| const tentativeVersion = avoidOldNotation(capturedVersion); | ||
| const rawVersion = tentativeVersion.split('-')[0]; | ||
| let version = semver.validRange(rawVersion) | ||
| ? tentativeVersion | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132850,17 +132850,20 @@ function getVersionFromFileContent(content, distributionName, versionFile) { | |
| javaVersionRegExp = | ||
|
/^java\s+(?:\S*-)?(? |
||
| } | ||
| else if (versionFileName == '.sdkmanrc') { | ||
|
javaVersionRegExp = /^java\s*=\s*(? |
||
| } | ||
| else { | ||
|
javaVersionRegExp = /(? |
||
| } | ||
| const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version) | ||
| const capturedVersion = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version) | ||
| ? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version | ||
| : ''; | ||
| if (!fileContent) { | ||
| core.debug(`Parsed version '${capturedVersion}' from file '${versionFileName}'`); | ||
| if (!capturedVersion) { | ||
| return null; | ||
| } | ||
| core.debug(`Version from file '${fileContent}'`); | ||
| const tentativeVersion = avoidOldNotation(fileContent); | ||
| const tentativeVersion = avoidOldNotation(capturedVersion); | ||
| const rawVersion = tentativeVersion.split('-')[0]; | ||
| let version = semver.validRange(rawVersion) | ||
| ? tentativeVersion | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -601,14 +601,29 @@ steps: | |
| ## Java version file | ||
| If the `java-version-file` input is specified, the action will extract the version from the file and install it. | ||
|
|
||
| Supported files are .java-version and .tool-versions. | ||
| In .java-version file, only the version should be specified (e.g., 17.0.7). | ||
| In .tool-versions file, java version should be preceded by the java keyword (e.g., java 17.0.7). | ||
| The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv). Similarly, 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/)). | ||
|
|
||
| If both java-version and java-version-file inputs are provided, the java-version input will be used. | ||
| 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 `.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 `.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. | ||
|
|
||
| **Example step using `Sdkman!`**: | ||
| ```yml | ||
| - name: Setup java | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version-file: '.sdkmanrc' | ||
| distribution: 'temurin' | ||
| ``` | ||
|
|
||
| **Example `.sdkmanrc`**: | ||
| ``` | ||
| java=17.0.7-tem | ||
| ``` | ||
|
|
||
| Valid entry options: | ||
| Valid entry options (does not apply to `.sdkmanrc`): | ||
| ``` | ||
| major versions: 8, 11, 16, 17, 21 | ||
| more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0 | ||
|
|
@@ -619,4 +634,4 @@ LTS versions : temurin-21.0.5+11.0.LTS | |
| If the file contains multiple versions, only the first one will be recognized. | ||
|
|
||
| ***NOTE***: | ||
| For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10). | ||
| For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,15 +68,15 @@ Pull requests are the easiest way to contribute changes to git repos at GitHub. | |
| Adding or changing tests is an integral part of making a change to the code. | ||
| Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workflows` folder, particularly take a look at the files with `e2e` prefix, for instance, [e2e-cache.yml](https://github.com/actions/setup-java/blob/main/.github/workflows/e2e-cache.yml). | ||
|
|
||
| - The contributor can add various types of tests (like unit tests or end-to-end tests), which, in his opinion, will be necessary and sufficient for testing new or changed functionality | ||
| - The contributor can add various types of tests (like unit tests or end-to-end tests), which, in their opinion, will be necessary and sufficient for testing new or changed functionality | ||
| - Tests should cover a successful execution, as well as some edge cases and possible errors | ||
| - As already mentioned, pull requests without tests will be considered more carefully by maintainers. If you are sure that in this situation the tests are not needed or cannot be implemented with a commensurate effort - please add this clarification message to your pull request | ||
|
|
||
| **Once you've filed the pull request:** | ||
|
|
||
| - CI will start automatically with some checks. Wait until the end of the execution and make sure that all checks passed successfully. If some checks fail, you can open them one by one, try to find the reason for failing and make changes to your code to resolve the problem | ||
| - Maintainers will review your pull request | ||
| - If a maintainer requests changes, first of all, try to think about his request critically and only after that implement and request another review | ||
| - If a maintainer requests changes, first of all, try to think about their request critically and only after that implement and request another review | ||
| - If your PR gets accepted, it will soon be merged into the main branch. But your contribution will take effect only after the release of a new version of the action and updating the major tag | ||
| > Sometimes maintainers reject pull requests and that's ok! Usually, along with rejection, we supply the reason for it. Nonetheless, we still really appreciate you taking the time to do it, and we don't take that lightly :heart: | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,20 +134,24 @@ export function getVersionFromFileContent( | |
| if (versionFileName == '.tool-versions') { | ||
| javaVersionRegExp = | ||
|
/^java\s+(?:\S*-)?(? |
||
| } else if (versionFileName == '.sdkmanrc') { | ||
|
javaVersionRegExp = /^java\s*=\s*(? |
||
| } else { | ||
|
javaVersionRegExp = /(? |
||
| } | ||
|
|
||
| const fileContent = content.match(javaVersionRegExp)?.groups?.version | ||
| const capturedVersion = content.match(javaVersionRegExp)?.groups?.version | ||
| ? (content.match(javaVersionRegExp)?.groups?.version as string) | ||
| : ''; | ||
| if (!fileContent) { | ||
|
|
||
| core.debug( | ||
| `Parsed version '${capturedVersion}' from file '${versionFileName}'` | ||
| ); | ||
| if (!capturedVersion) { | ||
| return null; | ||
| } | ||
|
|
||
| core.debug(`Version from file '${fileContent}'`); | ||
|
|
||
| const tentativeVersion = avoidOldNotation(fileContent); | ||
| const tentativeVersion = avoidOldNotation(capturedVersion); | ||
| const rawVersion = tentativeVersion.split('-')[0]; | ||
|
|
||
| let version = semver.validRange(rawVersion) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.