mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-26 13:23:05 +07:00
Fix index.js
This commit is contained in:
parent
3b539379a8
commit
b81836a248
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -4845,6 +4845,9 @@ function configAuthentication(feedUrl, existingFileLocation = '', processRoot =
|
|||||||
writeFeedToFile(feedUrl, existingNuGetConfig, tempNuGetConfig);
|
writeFeedToFile(feedUrl, existingNuGetConfig, tempNuGetConfig);
|
||||||
}
|
}
|
||||||
exports.configAuthentication = configAuthentication;
|
exports.configAuthentication = configAuthentication;
|
||||||
|
function isValidKey(key) {
|
||||||
|
return /^[\w\-\.]+$/i.test(key);
|
||||||
|
}
|
||||||
function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
||||||
console.log(`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`);
|
console.log(`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`);
|
||||||
let xml;
|
let xml;
|
||||||
@ -4910,8 +4913,8 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
|||||||
}
|
}
|
||||||
xml = xml.ele('packageSourceCredentials');
|
xml = xml.ele('packageSourceCredentials');
|
||||||
sourceKeys.forEach(key => {
|
sourceKeys.forEach(key => {
|
||||||
if (key.indexOf(' ') > -1) {
|
if (!isValidKey(key)) {
|
||||||
throw new Error("This action currently can't handle source names with spaces. Remove the space from your repo's NuGet.config and try again.");
|
throw new Error("Source name can contain letters, numbers, and '-', '_', '.' symbols only. Please, fix source name in NuGet.config and try again.");
|
||||||
}
|
}
|
||||||
xml = xml
|
xml = xml
|
||||||
.ele(key)
|
.ele(key)
|
||||||
|
Loading…
Reference in New Issue
Block a user