Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blogdown and bookdown examples need contents write permission #874

Merged
merged 9 commits into from
Aug 2, 2024
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).

# `v2.9.0` (2024-05-09)

* The `test-coverage.yaml` example workflow now handles global Codecov
Expand Down
28 changes: 28 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,17 @@ on:

name: Commands

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 @@ -459,6 +463,8 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -505,11 +511,15 @@ on:

name: render-rmarkdown

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 @@ -624,11 +634,15 @@ on:

name: Document

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 @@ -676,6 +690,8 @@ on:

name: Style

permissions: read-all

jobs:
style:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -781,6 +797,8 @@ on:

name: bookdown

permissions: read-all

jobs:
bookdown:
runs-on: ubuntu-latest
Expand All @@ -789,6 +807,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 @@ -930,6 +950,8 @@ on:

name: blogdown

permissions: read-all

jobs:
blogdown:
runs-on: ubuntu-latest
Expand All @@ -938,6 +960,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 @@ -1072,6 +1096,8 @@ on:

name: shiny-deploy

permissions: read-all

jobs:
shiny-deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -1148,6 +1174,8 @@ on:

name: lint-project

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
Loading