christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame^] | 1 | # Workflow derived from https://github.com/r-lib/actions/tree/master/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: Commands |
| 8 | |
| 9 | jobs: |
| 10 | document: |
| 11 | if: startsWith(github.event.comment.body, '/document') |
| 12 | name: document |
| 13 | runs-on: ubuntu-latest |
| 14 | env: |
| 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 16 | steps: |
| 17 | - uses: actions/checkout@v2 |
| 18 | |
| 19 | - uses: r-lib/actions/pr-fetch@v1 |
| 20 | with: |
| 21 | repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 22 | |
| 23 | - uses: r-lib/actions/setup-r@v1 |
| 24 | with: |
| 25 | use-public-rspm: true |
| 26 | |
| 27 | - uses: r-lib/actions/setup-r-dependencies@v1 |
| 28 | with: |
| 29 | extra-packages: roxygen2 |
| 30 | |
| 31 | - name: Document |
| 32 | run: Rscript -e 'roxygen2::roxygenise()' |
| 33 | |
| 34 | - name: commit |
| 35 | run: | |
| 36 | git config --local user.name "$GITHUB_ACTOR" |
| 37 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" |
| 38 | git add man/\* NAMESPACE |
| 39 | git commit -m 'Document' |
| 40 | |
| 41 | - uses: r-lib/actions/pr-push@v1 |
| 42 | with: |
| 43 | repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | |
| 45 | style: |
| 46 | if: startsWith(github.event.comment.body, '/style') |
| 47 | name: style |
| 48 | runs-on: ubuntu-latest |
| 49 | env: |
| 50 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 51 | steps: |
| 52 | - uses: actions/checkout@v2 |
| 53 | |
| 54 | - uses: r-lib/actions/pr-fetch@v1 |
| 55 | with: |
| 56 | repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 57 | |
| 58 | - uses: r-lib/actions/setup-r@v1 |
| 59 | |
| 60 | - name: Install dependencies |
| 61 | run: Rscript -e 'install.packages("styler")' |
| 62 | |
| 63 | - name: Style |
| 64 | run: Rscript -e 'styler::style_pkg()' |
| 65 | |
| 66 | - name: commit |
| 67 | run: | |
| 68 | git config --local user.name "$GITHUB_ACTOR" |
| 69 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" |
| 70 | git add \*.R |
| 71 | git commit -m 'Style' |
| 72 | |
| 73 | - uses: r-lib/actions/pr-push@v1 |
| 74 | with: |
| 75 | repo-token: ${{ secrets.GITHUB_TOKEN }} |