0

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.

kiran shinde
  • 51
  • 1
  • 4
  • Can you give us more details, for example what kind of actions you want GitLab runner to help you perform, and also more details on the error itself would be wonderful – Felix Fong Jan 18 '19 at 08:49
  • I am using the url in request call. But it gives response.statuscode as 404 when I include dynamic valued string in the url – kiran shinde Jan 21 '19 at 08:56

0 Answers0