Сначала рабочая команда:
с использованием переменной GITLAB_PAT, установленной в файле .Renviron
cred <- git2r::cred_token( token = 'GITLAB_PAT' );
remotes::install_gitlab('myuser/myproject',
credentials = cred ,upgrade = FALSE )
установка работает! но дает доступ ко всем приватным пакетам myuser.
Использование GitLab PAT из envvar GITLAB_PAT
Downloading GitLab repo myuser/myproject@master
from URL https://gitlab.com/api/v4/projects/12345678/repository/archive.tar.gz?sha=master
√ checking for file 'C:\Users\myuser\AppData\Local\Temp\RtmpCMKBuc\remotes7e0820dc515b\myproject-master-b31c5baa8f1d2d4967b00b739216cbb9b50d74b1/DESCRIPTION' (2.8s)
- preparing 'myproject': (526ms)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'myproject_0.1.0.tar.gz'
...
** testing if installed package keeps a record of temporary installation path
* DONE (myproject)
Во-вторых, моя неработающая попытка использовать DEPLOY_TOKEN:
с использованием DEPLOY_TOKEN , установите в файле .Renviron, чтобы иметь доступ на чтение только к репозиторию, содержащему пакет
cred <- git2r::cred_token( token = 'MYPROJECT_TOKEN' );
remotes::install_gitlab('myuser/myproject',
credentials = cred ,upgrade = FALSE )
-> сообщение о том, что доступ предоставляется с использованием Gitlab PAT, что в отличие от того, что я хочу.
Использование GitLab PAT из envvar GITLAB_PAT
Skipping install of 'myproject' from a gitlab remote, the SHA1 (b31c5bac) has not changed since last install.
Use `force = TRUE` to force installation
Итак, могу ли я использовать DEPLOY_TOKEN для установки пакета R из частного проекта на Gitlab?