Skip to content

Commit 7edaf3d

Browse files
committed
use_tidy_github_actions()
1 parent c2278c2 commit 7edaf3d

4 files changed

Lines changed: 52 additions & 29 deletions

File tree

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ jobs:
2424
matrix:
2525
config:
2626
- {os: macos-latest, r: 'release'}
27-
2827
- {os: windows-latest, r: 'release'}
29-
# use 4.0 or 4.1 to check with rtools40's older compiler
30-
- {os: windows-latest, r: 'oldrel-3'}
31-
3228
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
3329
- {os: ubuntu-latest, r: 'release'}
3430
- {os: ubuntu-latest, r: 'oldrel-1'}
@@ -41,28 +37,21 @@ jobs:
4137
R_KEEP_PKG_SOURCE: yes
4238

4339
steps:
44-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v6
4541

4642
- uses: r-lib/actions/setup-pandoc@v2
4743

48-
- uses: r-lib/actions/setup-tinytex@v2
49-
env:
50-
TINYTEX_INSTALLER: TinyTeX
51-
5244
- uses: r-lib/actions/setup-r@v2
5345
with:
5446
r-version: ${{ matrix.config.r }}
5547
http-user-agent: ${{ matrix.config.http-user-agent }}
56-
use-public-rspm: true
5748

5849
- uses: r-lib/actions/setup-r-dependencies@v2
5950
with:
6051
extra-packages: any::rcmdcheck
6152
needs: check
6253

6354
- uses: r-lib/actions/check-r-package@v2
64-
env:
65-
R_QUARTO_QUIET: false
6655
with:
6756
upload-snapshots: true
6857
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
2+
3+
on:
4+
# Using `pull_request_target` over `pull_request` for elevated `GITHUB_TOKEN`
5+
# privileges, otherwise we can't set `pull-requests: write` when the pull
6+
# request comes from a fork, which is our main use case (external contributors).
7+
#
8+
# `pull_request_target` runs in the context of the target branch (`main`, usually),
9+
# rather than in the context of the pull request like `pull_request` does. Due
10+
# to this, we must explicitly checkout `ref: ${{ github.event.pull_request.head.sha }}`.
11+
# This is typically frowned upon by GitHub, as it exposes you to potentially running
12+
# untrusted code in a context where you have elevated privileges, but they explicitly
13+
# call out the use case of reformatting and committing back / commenting on the PR
14+
# as a situation that should be safe (because we aren't actually running the untrusted
15+
# code, we are just treating it as passive data).
16+
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
17+
pull_request_target:
18+
19+
name: format-suggest.yaml
20+
21+
jobs:
22+
format-suggest:
23+
name: format-suggest
24+
runs-on: ubuntu-latest
25+
26+
permissions:
27+
# Required to push suggestion comments to the PR
28+
pull-requests: write
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
35+
- name: Install
36+
uses: posit-dev/setup-air@v1
37+
38+
- name: Format
39+
run: air format .
40+
41+
- name: Suggest
42+
uses: reviewdog/action-suggester@v1
43+
with:
44+
level: error
45+
fail_level: error
46+
tool_name: air

.github/workflows/pkgdown.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,24 @@ jobs:
2323
permissions:
2424
contents: write
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v6
2727

2828
- uses: r-lib/actions/setup-pandoc@v2
2929

3030
- uses: r-lib/actions/setup-r@v2
31-
with:
32-
use-public-rspm: true
3331

3432
- uses: r-lib/actions/setup-r-dependencies@v2
3533
with:
3634
extra-packages: any::pkgdown, local::.
3735
needs: website
3836

39-
- uses: r-lib/actions/setup-tinytex@v2
40-
4137
- name: Build site
4238
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
4339
shell: Rscript {0}
4440

4541
- name: Deploy to GitHub pages 🚀
4642
if: github.event_name != 'pull_request'
47-
uses: JamesIves/github-pages-deploy-action@v4.5.0
43+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
4844
with:
4945
clean: false
5046
branch: gh-pages

.github/workflows/test-coverage.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,15 @@ jobs:
1616
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1717

1818
steps:
19-
- uses: actions/checkout@v4
20-
21-
- uses: r-lib/actions/setup-pandoc@v2
19+
- uses: actions/checkout@v6
2220

2321
- uses: r-lib/actions/setup-r@v2
24-
with:
25-
use-public-rspm: true
2622

2723
- uses: r-lib/actions/setup-r-dependencies@v2
2824
with:
2925
extra-packages: any::covr, any::xml2
3026
needs: coverage
3127

32-
- uses: r-lib/actions/setup-tinytex@v2
33-
env:
34-
TINYTEX_INSTALLER: TinyTeX
35-
3628
- name: Test coverage
3729
run: |
3830
cov <- covr::package_coverage(
@@ -44,7 +36,7 @@ jobs:
4436
covr::to_cobertura(cov)
4537
shell: Rscript {0}
4638

47-
- uses: codecov/codecov-action@v5
39+
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
4840
with:
4941
# Fail if error if not on PR, or if on PR and token is given
5042
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
@@ -62,7 +54,7 @@ jobs:
6254

6355
- name: Upload test results
6456
if: failure()
65-
uses: actions/upload-artifact@v4
57+
uses: actions/upload-artifact@v7
6658
with:
6759
name: coverage-test-failures
6860
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)