Adding extra header to git-builder in RStudio Package Manager

We host our internal packages on Azure DevOps and I'd like to link these packages to RStudio Package Manager (RSPM) using a Personal Access Token (PAT). If I were to clone a repo manually, I'd do the following. First, I'd assign my PAT to a variable and then encode it as base 64.

PAT=<Personal Access Token goes here>
B64_PAT=$(printf ":$PAT" | base64)

Next, I would use git clone, but passing my encoded as an extra header, like so.

git -c http.extraheader="AUTHORIZATION: Basic ${B64_PAT}" clone https://xxxxx@dev.azure.com/xxxxx/xxxxxx/_git/xxxxxxx

This works just great.

To use a git repo with RSPM, though, I must use git-builder to build my package. My question is, how do I include the http.extraheader in my git-builder command? I have consulted the documentation, as well as the RSPM CLI help files, but it's not clear to me if this is possible or not. Any suggestions would be appreciated!

A solution is to adopt a different tack regarding PATs. Specifically, they can be prepended to the repo URL like so:

rspm create git-builder --url=https://<PAT GOES HERE>@dev.azure.com/xxxxx/xxxxxx/_git/xxxxxxx --source=my-source --branch=my-branch --build-trigger=tags

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.