From a57f4dcc814fa55691c9ee5fc6e07c7487cb69f1 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 13 Jan 2024 00:31:45 -0700 Subject: [PATCH] chore: update top level workflow permissions (#1848) --- .github/workflows/codacy-analysis.yml | 5 +++++ .github/workflows/codeql.yml | 5 +++++ .github/workflows/issue-comment-test.yml | 4 ++++ .github/workflows/manual-test.yml | 3 +++ .github/workflows/matrix-test.yml | 3 +++ .github/workflows/multi-job-test.yml | 6 +++--- .github/workflows/sync-release-version.yml | 7 ++++++- .github/workflows/test.yml | 4 ++++ .github/workflows/update-readme.yml | 4 ++++ .github/workflows/workflow-run-test.yml | 3 +++ 10 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index 22a29b75..6e8485b4 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -17,6 +17,11 @@ on: schedule: - cron: '15 16 * * 2' +permissions: + actions: read + contents: read + security-events: write + jobs: codacy-security-scan: # Cancel other workflows that are running for the same branch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d352feaa..3de65469 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,6 +20,11 @@ on: schedule: - cron: '44 20 * * 0' +permissions: + actions: read + contents: read + security-events: write + jobs: analyze: name: Analyze diff --git a/.github/workflows/issue-comment-test.yml b/.github/workflows/issue-comment-test.yml index 2c765dd6..029b559d 100644 --- a/.github/workflows/issue-comment-test.yml +++ b/.github/workflows/issue-comment-test.yml @@ -1,4 +1,8 @@ name: Issue Comment Test + +permissions: + contents: read + on: issue_comment: diff --git a/.github/workflows/manual-test.yml b/.github/workflows/manual-test.yml index a683cac6..a5b19628 100644 --- a/.github/workflows/manual-test.yml +++ b/.github/workflows/manual-test.yml @@ -1,5 +1,8 @@ name: Manual Test +permissions: + contents: read + on: workflow_dispatch: diff --git a/.github/workflows/matrix-test.yml b/.github/workflows/matrix-test.yml index fac34846..b2cc8224 100644 --- a/.github/workflows/matrix-test.yml +++ b/.github/workflows/matrix-test.yml @@ -1,5 +1,8 @@ name: Matrix Test +permissions: + contents: read + on: workflow_dispatch: pull_request: diff --git a/.github/workflows/multi-job-test.yml b/.github/workflows/multi-job-test.yml index b02766fb..5dc6ec84 100644 --- a/.github/workflows/multi-job-test.yml +++ b/.github/workflows/multi-job-test.yml @@ -1,5 +1,8 @@ name: Multi Job Test +permissions: + contents: read + on: push: branches: @@ -8,9 +11,6 @@ on: branches: - "**" -permissions: - contents: read - jobs: changed-files: name: Get changed files diff --git a/.github/workflows/sync-release-version.yml b/.github/workflows/sync-release-version.yml index 448a6e84..bf601bb3 100644 --- a/.github/workflows/sync-release-version.yml +++ b/.github/workflows/sync-release-version.yml @@ -1,4 +1,9 @@ -name: Update release version. +name: Update release version + +permissions: + contents: read + pull-requests: write + on: release: types: [published] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 789ae981..e4e29927 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,9 @@ name: CI +permissions: + contents: read + pull-requests: write + on: push: branches: diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index 0b6c1c33..6b970532 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -1,5 +1,9 @@ name: Format README.md +permissions: + contents: read + pull-requests: write + on: push: branches: diff --git a/.github/workflows/workflow-run-test.yml b/.github/workflows/workflow-run-test.yml index a5fcdf06..e83b6614 100644 --- a/.github/workflows/workflow-run-test.yml +++ b/.github/workflows/workflow-run-test.yml @@ -4,6 +4,9 @@ on: workflows: [Matrix Test] types: [completed] +permissions: + contents: read + jobs: on-success: runs-on: ubuntu-latest