mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-20 15:40:20 +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) {
|
if (sourceUrl) {
|
||||||
auth.configAuthentication(sourceUrl, configFile);
|
auth.configAuthentication(sourceUrl, configFile);
|
||||||
}
|
}
|
||||||
core.setOutput('dotnet-version', semver_1.default.maxSatisfying(installedDotnetVersions, '*', {
|
const comparisonRange = globalJsonFileInput
|
||||||
|
? versions.at(-1)
|
||||||
|
: '*';
|
||||||
|
const includePrereleaseOption = {
|
||||||
includePrerelease: true
|
includePrerelease: true
|
||||||
}));
|
};
|
||||||
|
const versionToOutput = semver_1.default.maxSatisfying(installedDotnetVersions, comparisonRange, includePrereleaseOption);
|
||||||
|
core.setOutput('dotnet-version', versionToOutput);
|
||||||
const matchersPath = path_1.default.join(__dirname, '..', '.github');
|
const matchersPath = path_1.default.join(__dirname, '..', '.github');
|
||||||
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
||||||
}
|
}
|
||||||
|
@ -74,13 +74,22 @@ export async function run() {
|
|||||||
auth.configAuthentication(sourceUrl, configFile);
|
auth.configAuthentication(sourceUrl, configFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
core.setOutput(
|
const comparisonRange: string = globalJsonFileInput
|
||||||
'dotnet-version',
|
? versions.at(-1)!
|
||||||
semver.maxSatisfying(installedDotnetVersions, '*', {
|
: '*';
|
||||||
|
|
||||||
|
const includePrereleaseOption = {
|
||||||
includePrerelease: true
|
includePrerelease: true
|
||||||
})
|
};
|
||||||
|
|
||||||
|
const versionToOutput = semver.maxSatisfying(
|
||||||
|
installedDotnetVersions,
|
||||||
|
comparisonRange,
|
||||||
|
includePrereleaseOption
|
||||||
);
|
);
|
||||||
|
|
||||||
|
core.setOutput('dotnet-version', versionToOutput);
|
||||||
|
|
||||||
const matchersPath = path.join(__dirname, '..', '.github');
|
const matchersPath = path.join(__dirname, '..', '.github');
|
||||||
core.info(`##[add-matcher]${path.join(matchersPath, 'csc.json')}`);
|
core.info(`##[add-matcher]${path.join(matchersPath, 'csc.json')}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user