Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

badge_github_version not dynamic? #50

Open
MurrayEfford opened this issue Feb 26, 2023 · 1 comment
Open

badge_github_version not dynamic? #50

MurrayEfford opened this issue Feb 26, 2023 · 1 comment

Comments

@MurrayEfford
Copy link

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
Copy link

Let's have a look at it:

  • badger::badge_github_version(pkg='MurrayEfford/secr', 'blue')
    gives you:
    [![](https://img.shields.io/badge/devel%20version-0.1.0.9004-blue.svg)](https://github.com/MurrayEfford/secr)

  • badger::badge_cran_release("secr")
    gives you:
    [![](https://www.r-pkg.org/badges/version/secr)](https://cran.r-project.org/package=secr)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants