GuangchuangYu / badger

Badge for R Package
https://cran.r-project.org/package=badger
198 stars 47 forks source link

badge_github_version not dynamic? #50

Open MurrayEfford opened 1 year ago

MurrayEfford commented 1 year ago

It seems that badger::badge_github_version generates a static badge that fails to update. e.g.

badger::badge_github_version(pkg='MurrayEfford/secr', 'blue') [1] ""

What am I missing?

obsaditelnost commented 2 months ago

Let's have a look at it:

badger or not... It does not really matter because the problem is beyond this package.

r-pkg.org provides help by offering us a SVG image. Github does not provide that service. The md will be rebuilt whenever you change the Rmd... if you change your package version and some R-files but not the Rmd, no single instance thinks it's responsible for updating the md-file... and the standard pre-commit hook of git also does not inform you about anything weird.

So this package can't really solve the problem without offering an external service like r-pkg does. You have different options:

  1. You should include devtools::build_readme() in your standard commands before you commit locally
  2. You could create a Github action that rebuilds the README.md on every push (I tried it and gave up tbh)
  3. You could create a pre-commit-hook that locally renders the README.md everytime you commit
  4. We could wait for someone (Github?) to offer the same service as r-pkg

I use option 1