Skip to content

Commit 91465f6

Browse files
committed
Update actions
1 parent 8c8ee0a commit 91465f6

File tree

2 files changed

+89
-3
lines changed

2 files changed

+89
-3
lines changed

.github/workflows/pr-commands.yaml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
name: pr-commands.yaml
8+
9+
permissions: read-all
10+
11+
jobs:
12+
document:
13+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
14+
name: document
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
permissions:
19+
contents: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: r-lib/actions/pr-fetch@v2
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
30+
31+
- uses: r-lib/actions/setup-r-dependencies@v2
32+
with:
33+
extra-packages: any::roxygen2
34+
needs: pr-document
35+
36+
- name: Document
37+
run: roxygen2::roxygenise()
38+
shell: Rscript {0}
39+
40+
- name: commit
41+
run: |
42+
git config --local user.name "$GITHUB_ACTOR"
43+
git config --local user.email "[email protected]"
44+
git add man/\* NAMESPACE
45+
git commit -m 'Document'
46+
47+
- uses: r-lib/actions/pr-push@v2
48+
with:
49+
repo-token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
style:
52+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
53+
name: style
54+
runs-on: ubuntu-latest
55+
env:
56+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
57+
permissions:
58+
contents: write
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: r-lib/actions/pr-fetch@v2
63+
with:
64+
repo-token: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- uses: r-lib/actions/setup-r@v2
67+
68+
- name: Install dependencies
69+
run: install.packages("styler")
70+
shell: Rscript {0}
71+
72+
- name: Style
73+
run: styler::style_pkg()
74+
shell: Rscript {0}
75+
76+
- name: commit
77+
run: |
78+
git config --local user.name "$GITHUB_ACTOR"
79+
git config --local user.email "[email protected]"
80+
git add \*.R
81+
git commit -m 'Style'
82+
83+
- uses: r-lib/actions/pr-push@v2
84+
with:
85+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ jobs:
3434
clean = FALSE,
3535
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3636
)
37+
print(cov)
3738
covr::to_cobertura(cov)
3839
shell: Rscript {0}
3940

40-
- uses: codecov/codecov-action@v4
41+
- uses: codecov/codecov-action@v5
4142
with:
4243
# Fail if error if not on PR, or if on PR and token is given
4344
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
44-
file: ./cobertura.xml
45-
plugin: noop
45+
files: ./cobertura.xml
46+
plugins: noop
4647
disable_search: true
4748
token: ${{ secrets.CODECOV_TOKEN }}
4849

0 commit comments

Comments
 (0)