···11+# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
22+33+on:
44+ # Using `pull_request_target` over `pull_request` for elevated `GITHUB_TOKEN`
55+ # privileges, otherwise we can't set `pull-requests: write` when the pull
66+ # request comes from a fork, which is our main use case (external contributors).
77+ #
88+ # `pull_request_target` runs in the context of the target branch (`main`, usually),
99+ # rather than in the context of the pull request like `pull_request` does. Due
1010+ # to this, we must explicitly checkout `ref: ${{ github.event.pull_request.head.sha }}`.
1111+ # This is typically frowned upon by GitHub, as it exposes you to potentially running
1212+ # untrusted code in a context where you have elevated privileges, but they explicitly
1313+ # call out the use case of reformatting and committing back / commenting on the PR
1414+ # as a situation that should be safe (because we aren't actually running the untrusted
1515+ # code, we are just treating it as passive data).
1616+ # https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
1717+ pull_request_target:
1818+1919+name: format-suggest.yaml
2020+2121+jobs:
2222+ format-suggest:
2323+ name: format-suggest
2424+ runs-on: ubuntu-latest
2525+2626+ permissions:
2727+ # Required to push suggestion comments to the PR
2828+ pull-requests: write
2929+3030+ steps:
3131+ - uses: actions/checkout@v6
3232+ with:
3333+ ref: ${{ github.event.pull_request.head.sha }}
3434+3535+ - name: Install
3636+ uses: posit-dev/setup-air@v1
3737+3838+ - name: Jarl format
3939+ uses: etiennebacher/setup-jarl@v0.1.0
4040+ with:
4141+ args: "check --fix"
4242+4343+ - name: Format
4444+ run: air format .
4545+4646+ - name: Suggest
4747+ uses: reviewdog/action-suggester@v1
4848+ with:
4949+ level: error
5050+ fail_level: error
5151+ tool_name: air+jarl
···11+# bootstrapper
22+33+<!-- badges: start -->
44+[](https://github.com/VisruthSK/bootstrapper/actions/workflows/R-CMD-check.yaml)
55+[](https://app.codecov.io/gh/VisruthSK/bootstrapper)
66+[](https://github.com/VisruthSK/bootstrapper/actions/workflows/test-coverage.yaml)
77+<!-- badges: end -->
88+99+The goal of bootstrapper is to ...
1010+1111+## Installation
1212+1313+You can install the development version of bootstrapper like so:
1414+1515+``` r
1616+# FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE?
1717+```
1818+1919+## Example
2020+2121+This is a basic example which shows you how to solve a common problem:
2222+2323+``` r
2424+library(bootstrapper)
2525+## basic example code
2626+```
2727+2828+## IMPLEMENT THIS WORKFLOW:
2929+3030+```r
3131+usethis::create_package(".")
3232+# publish repo to GitHub
3333+usethis::use_readme_md()
3434+unlink("*.Rproj")
3535+usethis::use_testthat()
3636+3737+# GitHub Actions Setup
3838+usethis::use_github_action("check-standard", badge = TRUE)
3939+usethis::use_github_action("test-coverage", badge = TRUE)
4040+usethis::use_github_action(
4141+ url = "https://github.com/visruthsk/bootstrapper/blob/main/.github/workflows/format-suggest.yaml"
4242+)
4343+usethis::use_pkgdown_github_pages()
4444+c(
4545+ "version: 2",
4646+ "updates:",
4747+ " - package-ecosystem: \"github-actions\"",
4848+ " directory: \"/\"",
4949+ " schedule:",
5050+ " interval: \"weekly\""
5151+) |>
5252+ write_to_path(fs::path(".github", "dependabot.yml"))
5353+5454+find_replace_in_dir("actions/checkout@v4", "actions/checkout@v6")
5555+find_replace_in_dir(
5656+ "JamesIves/github-pages-deploy-action@v4.5.0",
5757+ "JamesIves/github-pages-deploy-action@v4"
5858+)
5959+6060+usethis::use_tidy_description()
6161+# pick a license
6262+```
···11+# This file is part of the standard setup for testthat.
22+# It is recommended that you do not modify it.
33+#
44+# Where should you do additional test configuration?
55+# Learn more about the roles of various files in:
66+# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
77+# * https://testthat.r-lib.org/articles/special-files.html
88+99+library(testthat)
1010+library(bootstrapper)
1111+1212+test_check("bootstrapper")