Skip to content

Commit 1778ff8

Browse files
committed
Add pull-requests read permission to the release-notes-check workflow
This is necessary when the repository Actions configuration is set up without full access by default. In this case, the only access provided is `contents: read`, but this action needs to read the pull request too. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 2ac253a commit 1778ff8

File tree

9 files changed

+34
-0
lines changed

9 files changed

+34
-0
lines changed

.github/workflows/release-notes-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
check-release-notes:
1818
name: Check release notes are updated
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
2022
steps:
2123
- name: Check for a release notes update
2224
if: github.event_name == 'pull_request'

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@
5555
- Fix credentials not being passed to the `test-installation` job in the CI workflow.
5656
- Make sure credentials are configured for all jobs that check out the repository in the CI workflow.
5757
- Disable the new `check-class-attributes` check in pydoclint 0.5.3, as we use a different way to document class attributes.
58+
- Fix permissions issues with the `release-notes-check` workflow when the repository Actions configuration is set up without full access.

cookiecutter/migrate.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,5 +246,24 @@ echo "========================================================================"
246246
echo "Disabling new pydoclint's check-class-attributes check in "
247247
sed -i "/^allow-init-docstring/a check-class-attributes = false" pyproject.toml
248248

249+
echo "========================================================================"
250+
251+
echo "Adding pull-requests read permission to the release-notes-check workflow"
252+
patch --merge -p1 <<'EOF'
253+
diff --git a/.github/workflows/release-notes-check.yml b/.github/workflows/release-notes-check.yml
254+
index 1e35c1a..e97886b 100644
255+
--- a/.github/workflows/release-notes-check.yml
256+
+++ b/.github/workflows/release-notes-check.yml
257+
@@ -17,6 +17,8 @@ jobs:
258+
check-release-notes:
259+
name: Check release notes are updated
260+
runs-on: ubuntu-latest
261+
+ permissions:
262+
+ pull-requests: read
263+
steps:
264+
- name: Check for a release notes update
265+
if: github.event_name == 'pull_request'
266+
EOF
267+
249268
# Add a separation line like this one after each migration step.
250269
echo "========================================================================"

cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/release-notes-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
check-release-notes:
1818
name: Check release notes are updated
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
2022
steps:
2123
- name: Check for a release notes update
2224
if: github.event_name == 'pull_request'

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/workflows/release-notes-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
check-release-notes:
1818
name: Check release notes are updated
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
2022
steps:
2123
- name: Check for a release notes update
2224
if: github.event_name == 'pull_request'

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/workflows/release-notes-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
check-release-notes:
1818
name: Check release notes are updated
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
2022
steps:
2123
- name: Check for a release notes update
2224
if: github.event_name == 'pull_request'

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/workflows/release-notes-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
check-release-notes:
1818
name: Check release notes are updated
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
2022
steps:
2123
- name: Check for a release notes update
2224
if: github.event_name == 'pull_request'

tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/workflows/release-notes-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
check-release-notes:
1818
name: Check release notes are updated
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
2022
steps:
2123
- name: Check for a release notes update
2224
if: github.event_name == 'pull_request'

tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/release-notes-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
check-release-notes:
1818
name: Check release notes are updated
1919
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
2022
steps:
2123
- name: Check for a release notes update
2224
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)