mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-22 19:41:08 +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);
|
||||
}
|
||||
exports.configAuthentication = configAuthentication;
|
||||
function isValidKey(key) {
|
||||
return /^[\w\-\.]+$/i.test(key);
|
||||
}
|
||||
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}`);
|
||||
let xml;
|
||||
@ -4910,8 +4913,8 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
||||
}
|
||||
xml = xml.ele('packageSourceCredentials');
|
||||
sourceKeys.forEach(key => {
|
||||
if (key.indexOf(' ') > -1) {
|
||||
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.");
|
||||
if (!isValidKey(key)) {
|
||||
throw new Error("Source name can contain letters, numbers, and '-', '_', '.' symbols only. Please, fix source name in NuGet.config and try again.");
|
||||
}
|
||||
xml = xml
|
||||
.ele(key)
|
||||
|
Loading…
Reference in New Issue
Block a user