| Title: | 'Trustdown' Interface for R |
| Version: | 1.0.2 |
| Description: | A R interface to the 'vouch' project (https://github.com/mitchellh/vouch), which bills itself as "a community trust management system based on explicit vouches to participate". 'vouch' is a 'Nushell' module, so 'voucher' provides a R application programming interface (API) to modify the 'VOUCHED.td' database without 'Nushell'. 'voucher' does not depend on 'vouch' or 'Nushell'. |
| License: | GPL (≥ 3) |
| URL: | https://github.com/VisruthSK/voucher, https://voucher.visruth.com/ |
| Depends: | R (≥ 4.1.0) |
| Imports: | cli, fs |
| Suggests: | spelling, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| Encoding: | UTF-8 |
| Language: | en-US |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | no |
| Packaged: | 2026-03-09 05:54:33 UTC; visru |
| Author: | Visruth Srimath Kandali
|
| Maintainer: | Visruth Srimath Kandali <public@visruth.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-03-12 19:40:02 UTC |
Add a user to the vouched contributors list.
Description
This adds the user to the vouched list, removing any existing entry (vouched or denounced) for that user first.
Usage
add(username, write = FALSE, default_platform = "", vouched_file = "")
Arguments
username |
Username to vouch for (supports |
write |
Write the file in-place (default: output to stdout). |
default_platform |
Assumed platform for entries without explicit platform. |
vouched_file |
Path to vouched contributors file (default:
|
Value
Invisibly returns the updated trustdown text.
Attribution
Documentation for this function is copied nearly verbatim from vouch and is owned by Mitchell Hashimoto.
Examples
## Not run:
# Preview new file contents (default)
add("someuser")
# Write the file in-place
add("someuser", write = TRUE)
# Add with platform prefix
add("github:someuser", write = TRUE)
## End(Not run)
Check a user's vouch status.
Description
This checks if a user is vouched, denounced, or unknown.
Usage
check(username, default_platform = "", vouched_file = "", blame = FALSE)
Arguments
username |
Username to check (supports |
default_platform |
Assumed platform for entries without explicit platform. |
vouched_file |
Path to vouched contributors file (default:
|
blame |
Include git blame author for a matched entry when available. |
Value
One of "vouched", "denounced", or "unknown".
Attribution
Documentation for this function is copied nearly verbatim from vouch and is owned by Mitchell Hashimoto.
Examples
## Not run:
check("someuser")
check("github:someuser")
## End(Not run)
Denounce a user by adding them to the VOUCHED file with a minus prefix.
Description
This removes any existing entry for the user and adds them as denounced. An optional reason can be provided which will be added after the username.
Usage
denounce(
username,
write = FALSE,
reason = "",
default_platform = "",
vouched_file = ""
)
Arguments
username |
Username to denounce (supports |
write |
Write the file in-place (default: output to stdout). |
reason |
Optional reason for denouncement. |
default_platform |
Assumed platform for entries without explicit platform. |
vouched_file |
Path to vouched contributors file (default:
|
Value
Invisibly returns the updated trustdown text.
Attribution
Documentation for this function is copied nearly verbatim from vouch and is owned by Mitchell Hashimoto.
Examples
## Not run:
# Preview new file contents (default)
denounce("badactor")
# Denounce with a reason
denounce("badactor", reason = "Submitted AI slop")
# Write the file in-place
denounce("badactor", write = TRUE)
# Denounce with platform prefix
denounce("github:badactor", write = TRUE)
## End(Not run)
Initialize vouch in the current project
Description
Creates a starter VOUCHED.td file at .github/VOUCHED.td and ensures
.github is ignored in package builds by adding ^\\.github$ to
.Rbuildignore when needed.
Usage
use_vouch()
Details
If a vouch file already exists (VOUCHED.td or .github/VOUCHED.td), this
function exits without making changes.
Value
Invisibly returns NULL. Called for the side effects of writing a
starter VOUCHED.td file and updating .Rbuildignore.
Examples
## Not run:
project <- file.path(tempdir(), "voucher-use-vouch-example")
dir.create(project, recursive = TRUE)
old <- setwd(project)
on.exit(setwd(old), add = TRUE)
use_vouch()
## End(Not run)
Use 'vouch' GitHub Actions
Description
Function to add some 'vouch' workflows, like
usethis::use_github_action(). Details about the actions can be found at
https://github.com/mitchellh/vouch/tree/main/action; short summaries
copied from there follow.
Usage
vouch_gha(
action = c("check-issue", "check-pr", "manage-by-discussion", "manage-by-issue",
"sync-codeowners"),
save_as = NULL
)
Arguments
action |
The GitHub Action template workflow to add. |
save_as |
Name of the local workflow file. Defaults to |
Details
check-issue: Check if an issue author is a vouched contributor. Bots and collaborators with write access are automatically allowed. Denounced users are always blocked. When require-vouch is true (default), unvouched users are also blocked. Use auto-close to close issues from blocked users.
check-pr: Check if a PR author is a vouched contributor. Bots and collaborators with write access are automatically allowed. Denounced users are always blocked. When require-vouch is true (default), unvouched users are also blocked. Use auto-close to close PRs from blocked users.
manage-by-discussion: Manage contributor vouch status via discussion comments. When a collaborator with sufficient permissions comments vouch on a discussion, the discussion author is added to the vouched contributors list. When they comment denounce, the user is denounced. When they comment unvouch, the user is removed from the list entirely. The trigger keywords and required permission levels are configurable.
manage-by-issue: Manage contributor vouch status via issue comments. When a collaborator with sufficient permissions comments vouch on an issue, the issue author is added to the vouched contributors list. When they comment denounce, the user is denounced. When they comment unvouch, the user is removed from the list entirely. The trigger keywords and required permission levels are configurable.
sync-codeowners: Sync CODEOWNERS entries into the VOUCHED list. The action expands any team owners to their members and adds missing users to the vouch file.
Value
Invisibly returns a character vector of workflow file paths. Each
element is a length-1 character string giving the path written for the
corresponding requested action under .github/workflows.
Attribution
Documentation for this function is copied nearly verbatim from vouch and is owned by Mitchell Hashimoto.
Examples
## Not run:
project <- file.path(tempdir(), "voucher-gha-example")
dir.create(project, recursive = TRUE)
old <- setwd(project)
on.exit(setwd(old), add = TRUE)
vouch_gha("check-issue")
## End(Not run)