Skip to content

Commit 9640fde

Browse files
authored
ci(security): reduce workflows permissions (#355)
Set by default the permission to read-all in all the workflows and add the proper permissions for the following workflows: * CI * release-please * Release Publish Artifacts closes #352 Signed-off-by: Jonathan Gonzalez V. <[email protected]>
1 parent 016d7ff commit 9640fde

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ on:
44
pull_request:
55
workflow_dispatch:
66

7+
permissions: read-all
8+
79
jobs:
810
ci:
911
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
contents: write
1015
steps:
1116
- name: Cleanup Disk
1217
uses: jlumbroso/[email protected]

.github/workflows/publish-docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ concurrency:
1616
group: "pages"
1717
cancel-in-progress: false
1818

19+
permissions: read-all
20+
1921
jobs:
2022
build:
2123
runs-on: ubuntu-latest

.github/workflows/release-please.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ on:
55
branches:
66
- main
77

8+
permissions: read-all
9+
810
jobs:
911
release-please:
1012
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
1116
steps:
1217
# TODO: googleapis/release-please-action cannot sign commits yet.
1318
# We'll use the cli until there's a fix for

.github/workflows/release-publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ on:
33
release:
44
types: [published]
55

6+
permissions: read-all
7+
68
jobs:
79
release-publish-artifacts:
810
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: write
914
steps:
1015
- name: Checkout
1116
uses: actions/checkout@v4

0 commit comments

Comments
 (0)