swift icon indicating copy to clipboard operation
swift copied to clipboard

Bitrise ENV set https URL faling

Open Smitesh-P opened this issue 4 years ago • 2 comments

We are using GITLAB + BITRISE for iOS CI/CD pipeline

As part of CI/CD step, I set env_var | | **+ https_url=https://[REDACTED]:[REDACTED]@gitlab.org.io/ios/project.git

  • envman add --key GIT_REPOSITORY_URL --value https://[REDACTED]:[REDACTED]@gitlab.org.io/ios/project.git
  • '[' '!' -z 1234 ']'
  • envman add --key BITRISEIO_PULL_REQUEST_REPOSITORY_URL --value https://[REDACTED]:[REDACTED]@gitlab.org.io/ios/project.git**

After this step, I do run danger-swift ci steps at this step danger not able to authorize gitlab URL and it gives 401 unauthorized error. I think it may be due to GITHUB_REPOSITORY_URL need to be decoded before sending to KY process.

Error: HTTPError: Unauthorized at fn (/snapshot/danger-js/node_modules/ky/umd.js:251:12) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Ky._retry (/snapshot/danger-js/node_modules/ky/umd.js:319:12) { name: 'HTTPError', response: Response { size: 0, timeout: 0, [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null }, [Symbol(Response internals)]: { url: 'https://gitlab.com/api/v4/projects/https%3A%2F%2F[REDACTED]%3A[REDACTED]%40gitlab.project_domain.com%2Fios%2Fproject_name/merge_requests/1234/changes', status: 401, statusText: 'Unauthorized', headers: [Headers] } }, description: '401 Unauthorized' }

May be decode url as it may possible git env variables return encoded URL.

Screen Shot 2020-12-02 at 12 39 54 AM

Smitesh-P avatar Nov 26 '20 05:11 Smitesh-P

This feels like it needs more info to be understood, can you write a more detailed issue please?

orta avatar Nov 28 '20 18:11 orta

@Smitesh-P how did u resolve this issue. Even I'm facing this issue in my project ?

pavank30 avatar Jan 02 '24 08:01 pavank30