Skip to content

Commit

Permalink
update dist file
Browse files Browse the repository at this point in the history
sharma-shreyas committed Sep 24, 2024
1 parent 991b6aa commit 2f4583b
Showing 1 changed file with 58 additions and 15 deletions.
73 changes: 58 additions & 15 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -34803,23 +34803,66 @@ ${content}`;
CI_COMMIT_SHA,
"getAssetName"
);
var matches = regExp.exec(fileContents);
const startRegex =
/{{\s*config\s*\(/im;
const startMatch = fileContents.match(startRegex);
let configSection = ''
if (startMatch) {
const startIndex = startMatch.index;
const openParensIndex = fileContents.indexOf('(', startIndex) + 1;
let openParensCount = 1;
let endIndex = openParensIndex;

while (openParensCount > 0 && endIndex < fileContents.length) {
const char = fileContents[endIndex];

if (char === '(') {
openParensCount++;
} else if (char === ')') {
openParensCount--;
}
endIndex++;
}

const endMarker = '}}';
const finalEndIndex = fileContents.indexOf(endMarker, endIndex) + endMarker.length;

logger_logger.withInfo(
"Successfully executed regex matching",
gitlab_integration_integrationName,
CI_COMMIT_SHA,
"getAssetName"
);
configSection = fileContents.substring(startIndex, finalEndIndex);
logger_logger.withInfo(
"Extracted config section",
gitlab_integration_integrationName,
CI_COMMIT_SHA,
"getAssetName"
);

if (matches) {
logger_logger.withInfo(
`Found a match: ${matches[1].trim()}`,
gitlab_integration_integrationName,
CI_COMMIT_SHA,
"getAssetName"
);
return matches[1].trim();
if (configSection){
logger_logger.withInfo(
"Executing final regex",
gitlab_integration_integrationName,
CI_COMMIT_SHA,
"getAssetName"
);

var matches = regExp.exec(configSection);

logger_logger.withInfo(
"Successfully executed regex matching",
gitlab_integration_integrationName,
CI_COMMIT_SHA,
"getAssetName"
);

}
if (matches) {
logger_logger.withInfo(
`Found a match: ${matches[1].trim()}`,
gitlab_integration_integrationName,
CI_COMMIT_SHA,
"getAssetName"
);

return matches[1].trim();
}
}
}

0 comments on commit 2f4583b

Please sign in to comment.