Skip to content

Add spell check and vignette links #217

Add spell check and vignette links

Add spell check and vignette links #217

Workflow file for this run

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
issue_comment:
types: [created]
name: pr-commands
permissions: read-all
jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GTHB_PAT }}
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GTHB_PAT }}
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: pr-document
- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}
- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE DESCRIPTION
git commit -m 'Document (GHA)' || echo "No changes to commit"
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GTHB_PAT }}
style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GTHB_PAT }}
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GTHB_PAT }}
- uses: r-lib/actions/setup-r@v2
- name: Install air
run: curl -LsSf https://github.com/posit-dev/air/releases/latest/download/air-installer.sh | sh
- name: Install styler
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: styler, roxygen2
- name: Style code
run: air format .
- name: Style vignettes
run: styler::style_dir("vignettes/")
shell: Rscript {0}
- name: Commit changes
run: |
if FILES_TO_COMMIT=($(git diff-index --name-only ${{ github.sha }} \
| egrep --ignore-case '\.(R|[qR]md|Rmarkdown|Rnw|Rprofile)$'))
then
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git commit ${FILES_TO_COMMIT[*]} -m "Style code (GHA)"
else
echo "No changes to commit"
fi
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GTHB_PAT }}