Skip to content

Commit

Permalink
Blogdown and bookdown examples need contents write permission (#874)
Browse files Browse the repository at this point in the history
* Enable contents write permission

* Enable contents write permission

* Enable contents write permission

* Enable contents write permission

* Enable contents write permission

* render README.Rmd

* NEWS for fixed repo permissions in examples

---------

Co-authored-by: Gábor Csárdi <csardi.gabor@gmail.com>
  • Loading branch information
remlapmot and gaborcsardi authored Aug 2, 2024
1 parent 15dc534 commit fd93f72
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
unchanged, on all R versions. To avoid using a P3M snapshot on R 3.6.x,
set the `RSPM_PIN_3_6` environment variable to `false`.

* Example blogdown, bookdown, document, pr-commands and render-markdown
workflows now correctly have write permission to repository contents
(#874, @remlapmot).

* `[check-r-package]`: you can now set`upload-snapshots` to `always`, to
upload snapshots even after failures (#871).

Expand Down
28 changes: 28 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,17 @@ name: pr-commands.yaml
permissions: read-all
permissions: read-all
jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -461,6 +465,8 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -509,11 +515,15 @@ name: render-rmarkdown.yaml
permissions: read-all
permissions: read-all
jobs:
render-rmarkdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -630,11 +640,15 @@ name: document.yaml
permissions: read-all
permissions: read-all
jobs:
document:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -684,6 +698,8 @@ name: style.yaml
permissions: read-all
permissions: read-all
jobs:
style:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -791,6 +807,8 @@ name: bookdown.yaml
permissions: read-all
permissions: read-all
jobs:
bookdown:
runs-on: ubuntu-latest
Expand All @@ -799,6 +817,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -942,6 +962,8 @@ name: blogdown.yaml
permissions: read-all
permissions: read-all
jobs:
blogdown:
runs-on: ubuntu-latest
Expand All @@ -950,6 +972,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -1086,6 +1110,8 @@ name: shiny-deploy.yaml
permissions: read-all
permissions: read-all
jobs:
shiny-deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -1164,6 +1190,8 @@ name: lint-project.yaml
permissions: read-all
permissions: read-all
jobs:
lint-project:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions examples/blogdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions examples/bookdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions examples/document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions examples/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -52,6 +54,8 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions examples/render-rmarkdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down

0 comments on commit fd93f72

Please sign in to comment.