mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-18 06:35:09 +00:00
Change logic of outputting when global.json is used
This commit is contained in:
parent
12c47bed3c
commit
75d47e04fb
9
dist/index.js
vendored
9
dist/index.js
vendored
@ -483,9 +483,14 @@ function run() {
|
||||
if (sourceUrl) {
|
||||
auth.configAuthentication(sourceUrl, configFile);
|
||||
}
|
||||
core.setOutput('dotnet-version', semver_1.default.maxSatisfying(installedDotnetVersions, '*', {
|
||||
const comparisonRange = globalJsonFileInput
|
||||
? versions.at(-1)
|
||||
: '*';
|
||||
const includePrereleaseOption = {
|
||||
includePrerelease: true
|
||||
}));
|
||||
};
|
||||
const versionToOutput = semver_1.default.maxSatisfying(installedDotnetVersions, comparisonRange, includePrereleaseOption);
|
||||
core.setOutput('dotnet-version', versionToOutput);
|
||||
const matchersPath = path_1.default.join(__dirname, '..', '.github');
|
||||
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
||||
}
|
||||
|
@ -74,13 +74,22 @@ export async function run() {
|
||||
auth.configAuthentication(sourceUrl, configFile);
|
||||
}
|
||||
|
||||
core.setOutput(
|
||||
'dotnet-version',
|
||||
semver.maxSatisfying(installedDotnetVersions, '*', {
|
||||
includePrerelease: true
|
||||
})
|
||||
const comparisonRange: string = globalJsonFileInput
|
||||
? versions.at(-1)!
|
||||
: '*';
|
||||
|
||||
const includePrereleaseOption = {
|
||||
includePrerelease: true
|
||||
};
|
||||
|
||||
const versionToOutput = semver.maxSatisfying(
|
||||
installedDotnetVersions,
|
||||
comparisonRange,
|
||||
includePrereleaseOption
|
||||
);
|
||||
|
||||
core.setOutput('dotnet-version', versionToOutput);
|
||||
|
||||
const matchersPath = path.join(__dirname, '..', '.github');
|
||||
core.info(`##[add-matcher]${path.join(matchersPath, 'csc.json')}`);
|
||||
} catch (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user