浏览代码

ci: harden permissions for GitHub Workflows (#11174)

* build: harden main.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>

* build: harden project.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>

* Update project.yml

The permissions are not necessary, because a separate token is used `GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}`
Alex 1 年之前
父节点
当前提交
065f5ffc5a
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 3 0
      .github/workflows/main.yml
  2. 1 0
      .github/workflows/project.yml

+ 3 - 0
.github/workflows/main.yml

@@ -14,6 +14,9 @@ concurrency:
   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
   cancel-in-progress: true
   cancel-in-progress: true
 
 
+permissions:
+  contents: read # to fetch code (actions/checkout)
+
 jobs:
 jobs:
   tests:
   tests:
     name: Run tests
     name: Run tests

+ 1 - 0
.github/workflows/project.yml

@@ -9,6 +9,7 @@ concurrency:
   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
   cancel-in-progress: true
   cancel-in-progress: true
 
 
+permissions: {}
 jobs:
 jobs:
   add-to-project:
   add-to-project:
     name: Add to project
     name: Add to project