-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.49 KB
/
auto-format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: auto-format
on:
workflow_dispatch:
pull_request:
env:
GH_TOKEN: ${{ github.token }}
jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- uses: actions/checkout@v4
if: github.event_name == 'push'
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::.
needs: Suggests
- name: render README.Rmd
shell: Rscript {0}
run: |
rmarkdown::render("README.Rmd")
- name: update CITATION.cff
shell: Rscript {0}
run: |
# Customize with your own code
# See https://docs.ropensci.org/cffr/articles/cffr.html
# Write your own keys
mykeys <- list()
# Create your CITATION.cff file
cffr::cff_write(keys = mykeys)
- name: format
uses: pre-commit/[email protected]
continue-on-error: true
- name: commit & push
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "ci: 🤖 auto-format" && git push || echo "nothing to commit"