check-r-package.yml
Bundles the standard check suite for R package repositories (such as Morrison-Lab/rpt). Replaces individual hygiene and R code review checks with a single composite action or reusable workflow call.
What it runs
Runs the full Morrison-Lab repository hygiene pass plus R package-specific checks:
check-junk-files.yml: OS and editor detritus (.DS_Store,Thumbs.db,.Rhistory, etc.)check-secrets.yml: Gitleaks scan of git history for committed credentials and tokenscheck-non-standard-chars.yml: flags non-standard unicode characters, curly quotes, and smart dashescheck-new-line-breaks.yml: enforces semantic line breaks on modified lines in diffscheck-typos.yml: crate-ci/typos CLI scan for spelling errors on modified filescheck-ai-tells.yml: scans narrative prose (*.md,*.Rmd,*.qmd) for AI cliches and tellslint-yaml.yml: yamllint over tracked YAML fileslint-workflows.yml: actionlint and zizmor over GitHub Actions workflowslint-markdown.yml: markdownlint-cli2 over tracked Markdown filescheck-duplicate-roxygen.yml: detects duplicated@paramdocumentation acrossR/filescheck-one-function-per-file.yml: enforces single function definition per file inR/check-formatting.yml: verifies R code formatting via Air (posit-dev/setup-air)check-extra.yml: runs extra checks (warnings as errors, readme freshness) when opt-in
Every check is enabled by default (except check-extra, which is opt-in). Opt out of any specific check by passing its boolean flag as false.
PR metadata governance workflows that inspect pull request labels (check-news.yml, version-check.yml) remain dedicated standalone workflows because they require pull-requests: read permissions to inspect live labels from the GitHub API.
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
fail |
boolean | true |
Fail the job on findings (else warn only). |
check-junk-files |
boolean | true |
Enable junk files check. |
junk-patterns |
string | see check-junk-files.qmd |
Gitignore patterns naming junk files. |
junk-paths-ignore |
string | '' |
Paths to exempt from junk files scan. |
check-secrets |
boolean | true |
Enable gitleaks secrets scan. |
secrets-config |
string | '' |
Custom gitleaks config file path. |
secrets-paths-ignore |
string | '' |
Regex paths to exempt from secrets scan. |
check-non-standard-chars |
boolean | true |
Enable non-standard character check. |
non-standard-chars-extensions |
string | '.R, .qmd, .md' |
File extensions to check for non-standard characters. |
check-new-line-breaks |
boolean | true |
Enable semantic line break check. |
new-line-breaks-base-ref |
string | '' |
Base ref for diff-scoping new line breaks. |
new-line-breaks-globs |
string | '' |
Globs to check for new line breaks. |
check-typos |
boolean | true |
Enable typos check. |
typos-config |
string | '' |
Typos configuration file path. |
typos-base-ref |
string | '' |
Base ref for diff-scoping typo checks. |
check-ai-tells |
boolean | true |
Enable AI tells check on prose. |
ai-tells-threshold |
string | '10' |
Maximum allowed tell density (per 1,000 words). |
ai-tells-ignore |
string | '' |
Comma- or space-separated list of tells to ignore. |
lint-yaml |
boolean | true |
Enable YAML linting. |
yaml-config-file |
string | '' |
Custom yamllint config file path. |
yaml-paths-ignore |
string | '' |
Patterns to exclude from YAML linting. |
lint-workflows |
boolean | true |
Enable workflow linting. |
workflows-path |
string | '.' |
Path to workflow files. |
lint-markdown |
boolean | true |
Enable Markdown linting. |
markdown-config-file |
string | '' |
Markdownlint config file path. |
markdown-globs |
string | '*.md' |
Git pathspecs of Markdown files to lint. |
markdown-paths-ignore |
string | '' |
Paths to exempt from Markdown linting. |
markdown-base-ref |
string | '' |
Base ref for list-item splice checks. |
check-duplicate-roxygen |
boolean | true |
Enable duplicate roxygen documentation check. |
duplicate-roxygen-path |
string | '.' |
Directory path to scan for duplicate roxygen docs. |
check-one-function-per-file |
boolean | true |
Enforce one function per file in R/. |
one-function-per-file-path |
string | 'R' |
Path to R directory. |
check-extra |
boolean | false |
Run extra R checks (warnings, random-order, readme). |
extra-check |
string | 'warnings' |
Extra check type to run. |
check-formatting |
boolean | true |
Enable Air R code formatting check. |
air-version |
string | '0.11.0' |
Air release version to install. |
air-path |
string | '.' |
Path to format-check. |
Example
name: Check R package
on:
push:
branches: [main]
pull_request:
jobs:
check:
permissions:
contents: read
uses: Morrison-Lab/gha/.github/workflows/check-r-package.yml@v3