diff --git a/.github/workflows/ci-jobs.yml b/.github/workflows/ci-jobs.yml index a32265b8deda..0c7c1c3733ff 100644 --- a/.github/workflows/ci-jobs.yml +++ b/.github/workflows/ci-jobs.yml @@ -18,9 +18,15 @@ name: "CI jobs" on: workflow_call: +permissions: + contents: read + jobs: changes: runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: read outputs: java: ${{ steps.filter.outputs.java }} steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4509c176433..4344f2ccde44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,14 @@ env: MYSQL_DRIVER_CLASSNAME: com.mysql.jdbc.Driver # Used to set druid config in docker image for revised ITs SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 +permissions: + contents: read + jobs: ci: + permissions: + contents: read + pull-requests: read uses: ./.github/workflows/ci-jobs.yml quality-gate: @@ -50,6 +56,8 @@ jobs: actions-timeline: needs: [ci] + permissions: + actions: read runs-on: ubuntu-24.04 if: ${{ !cancelled() }} steps: diff --git a/.github/workflows/cron-job-its.yml b/.github/workflows/cron-job-its.yml index 1339d16bba1b..60fa1b981d9f 100644 --- a/.github/workflows/cron-job-its.yml +++ b/.github/workflows/cron-job-its.yml @@ -33,6 +33,9 @@ concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }}' # group workflows only on pull_requests and not on branch commits cancel-in-progress: true +permissions: + contents: read + jobs: security_vulnerabilities: # Pull requests from forks get no secrets, and dependency-check fails without an NVD API key. diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml index 42dc213405b9..8585df0b7e77 100644 --- a/.github/workflows/docker-tests.yml +++ b/.github/workflows/docker-tests.yml @@ -17,6 +17,9 @@ name: "Docker Tests using Distribution Image" on: workflow_call: +permissions: + contents: read + jobs: run-docker-tests: name: Run Docker tests diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 426920c1d9c0..09177f5785a0 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -23,6 +23,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + pull-requests: read + jobs: conventional-commits: if: github.repository == 'apache/druid' && github.event.pull_request.base.ref == 'master' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index f95d98064345..bef5aacce603 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -19,6 +19,11 @@ on: schedule: - cron: '0 0 * * *' # Run every day at midnight +permissions: + actions: write + issues: write + pull-requests: write + jobs: stale: runs-on: ubuntu-24.04 diff --git a/.github/workflows/worker.yml b/.github/workflows/worker.yml index eea1f701e33e..9daa90f03ed2 100644 --- a/.github/workflows/worker.yml +++ b/.github/workflows/worker.yml @@ -55,6 +55,9 @@ env: GITHUB_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GITHUB_WORKFLOW_REF: ${{ github.workflow_ref }} +permissions: + contents: read + jobs: execute: name: "${{ inputs.key }}"