-
Notifications
You must be signed in to change notification settings - Fork 301
Description
Reported by @SunnyTseng π
Error we observe, with the backtrace hinting at pick_tag() being the problem:
> usethis::use_github_action()
Which action do you want to add? (0 to exit)
(See <https://github.com/r-lib/actions/tree/v2/examples> for other options)
1: check-standard: Run `R CMD check` on Linux, macOS, and Windows
2: test-coverage: Compute test coverage and report to https://about.codecov.io
3: pr-commands: Add /document and /style commands for pull requests
Selection: 1
Error: invalid version specification ββ
Backtrace:
1. usethis::use_github_action()
3. usethis:::latest_release()
4. usethis:::pick_tag(tag_names)
5. base::numeric_version(sub("^[^0-9]*", "", dat$nm))
6. base::.make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)use_github_action() finds the ref part of the URL to the workflow by picking the latest release of the r-lib/actions repository.
Line 90 in 9e64daf
| ref <- ref %||% latest_release() |
In latest_release(), the release names are extracted via GitHub API:
Lines 260 to 270 in 9e64daf
| raw_releases <- gh::gh( | |
| "/repos/{owner}/{repo}/releases", | |
| owner = spec_owner(parsed$repo_spec), | |
| repo = spec_repo(parsed$repo_spec), | |
| .api_url = parsed$host, | |
| .limit = Inf | |
| ) | |
| tag_names <- purrr::discard( | |
| map_chr(raw_releases, "tag_name"), | |
| map_lgl(raw_releases, "prerelease") | |
| ) |
Today these names are c("v2", "sysreqs", "v1"). (Yesterday there was a new release of the r-lib/actions repo called "sysreqs". https://github.com/r-lib/actions/releases)
In pick_tag(), the line below transforms each of the names to a numeric version
Line 278 in 9e64daf
| dat$version <- numeric_version(sub("^[^0-9]*", "", dat$nm)) |
With "sysreqs", it doesn't work:
numeric_version(sub("^[^0-9]*", "", "sysreqs"))
#> Error: invalid version specification ''Created on 2024-03-26 with reprex v2.1.0