Skip to content

Commit 5a20821

Browse files
committed
Contain workflow permissions
This commit will resolve the CodeQL warning `actions/missing-workflow-permissions`: > If a GitHub Actions job or workflow has no explicit permissions set, > then the repository permissions are used. Repositories created under > organizations inherit the organization permissions. The organizations > or repositories created before February 2023 have the default > permissions set to read-write. Often these permissions do not adhere > to the principle of least privilege and can be reduced to read-only, > leaving the `write` permission only to a specific types as > `issues: write` or `pull-requests: write`. > > Recommendation > > Add the `permissions` key to the job or the root of workflow (in this > case it is applied to all jobs in the workflow that do not have their > own `permissions` key) and assign the least privileges required to > complete the task.
1 parent 46ae4be commit 5a20821

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
ci:
1215
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)