From f39a05903f86e90b83785ad7803d64f35f3d8f49 Mon Sep 17 00:00:00 2001 From: Enrique Lacal Date: Fri, 24 Jan 2025 11:28:43 +0000 Subject: [PATCH] OpenSSF Scorecard: fine grained workflow permissions Signed-off-by: Enrique Lacal Signed-off-by: Ry Jones --- .github/workflows/docker_main.yml | 7 ++++--- .github/workflows/docker_release.yml | 7 ++++--- .github/workflows/docs.yml | 4 ++++ .github/workflows/go.yml | 4 ++++ .github/workflows/integration.yml | 3 +++ .github/workflows/solidity.yml | 3 +++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker_main.yml b/.github/workflows/docker_main.yml index 94eadaf729..e150252780 100644 --- a/.github/workflows/docker_main.yml +++ b/.github/workflows/docker_main.yml @@ -8,12 +8,13 @@ on: - '.github/**' # exclude .github directory - '**.md' # exclude all markdown files +permissions: + contents: read + packages: write + jobs: docker: runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/docker_release.yml b/.github/workflows/docker_release.yml index 11a5c311a0..181781b2a1 100644 --- a/.github/workflows/docker_release.yml +++ b/.github/workflows/docker_release.yml @@ -4,13 +4,14 @@ on: release: types: [released, prereleased] +permissions: + contents: read + packages: write + jobs: docker: runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b37a48995e..5495a8053d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,6 +7,10 @@ on: pull_request: release: types: [released] + +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b3a754fea4..273fdd1c21 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,6 +18,10 @@ on: workflow_dispatch: +permissions: + contents: read + packages: write + jobs: build: env: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index cba43d3dfe..256b3bc77b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -7,6 +7,9 @@ on: - cron: "0 0 * * *" workflow_dispatch: +permissions: + contents: read + jobs: e2e-test: runs-on: firefly-ubuntu-latest diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml index 47ebecd615..985b6f22e1 100644 --- a/.github/workflows/solidity.yml +++ b/.github/workflows/solidity.yml @@ -3,6 +3,9 @@ name: Solidity Tests on: pull_request: branches: [main] + permissions: + contents: read + packages: read jobs: solidity-test: