Fix use_github for https protocol with github PAT #340
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #320 (use_github does not push with https protocol and GITHUB_PAT), closes #334 and contributes to #322.
As discussed, if no token is provided as argument (
auth_token = NULL
) inuse_github
, the default expected behaviour (GITHUB_PAT
orGITHUB_TOKEN
env var) is used throughgh_token()
.For
use_github
to work, I needed to deal withgit2r
cran or dev version. This is now included:git2r::head
for version <= 0.21.0 (currently cran version of git2r)git2r::repository_head
for version > 0.21.0 (currently dev version of git2rLastly, I included a manual test file for
use_github
and https. I need to set up ssh on my computer to add ssh test. Could do it but in another PR.I think manual test file are great for this kind of interactive 📦 like
usethis
. However, I am thinking that it could be improved by aRmd
test report or usingtestthat
in manual test script. If your are insterested, I am willing to work on something.Hope this PR suits you. Tell me what I need to adjust if necessary.