Skip to content

[panelset] output as default view #189

[panelset] output as default view

[panelset] output as default view #189

Workflow file for this run

on:
issue_comment:
types: [created]
name: Commands
jobs:
document:
if: startsWith(github.event.comment.body, '/document')
name: document
runs-on: ubuntu-20.04
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install pak
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
shell: Rscript {0}
- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pak(c("rmarkdown", "fs", "metathis", "devtools", "ggplot2"))
shell: Rscript {0}
- name: Document
run: Rscript make.R
- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add -u .
git add -f docs/*/*_files # rendered files that would be missed by heavy-handed gitignore
git commit -m 'Update docs'
- uses: r-lib/actions/pr-push@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
style:
if: startsWith(github.event.comment.body, '/style')
name: style
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v1
- name: Install dependencies
run: |
options(repos = c(gadenbuie = "https://gadenbuie.r-universe.dev", getOption("repos")))
install.packages("grkstyle", dependencies = TRUE)
shell: Rscript {0}
- name: Style
run: Rscript -e 'grkstyle::grk_style_pkg(".")'
- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'grkstyle::grk_style_pkg()'
- uses: r-lib/actions/pr-push@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
bump_version:
if: startsWith(github.event.comment.body, '/bump_version')
name: bump_version
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v1
- name: Install {desc}
run: Rscript -e 'install.packages("desc")'
- name: Bump version
run: |
bump_which <- trimws(sub('^/bump_version', '', '${{ github.event.comment.body }}'))
if (identical(bump_which, "")) {
bump_which <- "patch"
}
if (!bump_which %in% c("major", "minor", "patch", "dev")) {
stop("Usage: `/bump_version [major, minor, patch, dev]`")
}
desc::desc_bump_version(bump_which)
shell: Rscript {0}
- name: Get new version
run: Rscript -e "cat(sep = '', 'version=', as.character(desc::desc_get_version()))" >> $GITHUB_ENV
- name: Commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add DESCRIPTION
git commit -m "v${{ env.version }}"
- uses: r-lib/actions/pr-push@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}