I am running my nodejs code in the pipeline in Gitlab CI/CD. Gitlab is only able to find Hardcoded paths from my git repositories. Here's an example
var url=`https://gitlab.com/api/v4/projects/10241783/repository/files/kmfs%2F1BHK0001%2Fmanifest%2Ejson?ref=master&private_token=rSAoHgVT5RR18JrysyyE`
Here gitlab is able to find the filepath with 200 response code. But if i do this
var url=`https://gitlab.com/api/v4/projects/10241783/repository/files/${filePath1}?ref=master&private_token=rSAoHgVT5RR18JrysyyE`;
// filepPath1=kmfs%2F1BHK0001%2Fmanifest%2Ejson
request(url, function (error, response, body) {
if(response.statusCode == 404){
console.log( "Error 404 exists");
}
It fails to find the path if I provide a dynamic string of the path concatenated or added.
Can you please help me to find the way to do this? Or suggest a way to check if gitlab repository or file exists.