From 309116d5a58e1cff7b3fe80bfbf078929731f453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ad=C3=A1mek?= Date: Wed, 18 Nov 2026 09:47:03 +0100 Subject: [PATCH] ci: scope the release permissions to the publish jobs --- .github/workflows/node-release.yaml | 9 +++++++-- .github/workflows/node-test.yaml | 3 +-- .github/workflows/python-release.yaml | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node-release.yaml b/.github/workflows/node-release.yaml index 0130ac2f..4042c2e5 100644 --- a/.github/workflows/node-release.yaml +++ b/.github/workflows/node-release.yaml @@ -5,8 +5,7 @@ env: MACOSX_DEPLOYMENT_TARGET: '10.13' RUSTFLAGS: '--cfg reqwest_unstable' permissions: - contents: write - id-token: write + contents: read on: workflow_dispatch: inputs: @@ -36,6 +35,10 @@ jobs: name: Publish runs-on: ubuntu-latest needs: [test] + environment: npm + permissions: + contents: read + id-token: write # Required for OIDC steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: @@ -108,6 +111,8 @@ jobs: name: Generate changelog needs: [publish] runs-on: ubuntu-latest + permissions: + contents: write # Required to create the GitHub release steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 diff --git a/.github/workflows/node-test.yaml b/.github/workflows/node-test.yaml index 90988287..8e5012e4 100644 --- a/.github/workflows/node-test.yaml +++ b/.github/workflows/node-test.yaml @@ -5,8 +5,7 @@ env: MACOSX_DEPLOYMENT_TARGET: '10.13' RUSTFLAGS: '--cfg reqwest_unstable' permissions: - contents: write - id-token: write + contents: read 'on': push: branches: diff --git a/.github/workflows/python-release.yaml b/.github/workflows/python-release.yaml index bae53d9a..fc6cf31f 100644 --- a/.github/workflows/python-release.yaml +++ b/.github/workflows/python-release.yaml @@ -1,7 +1,6 @@ name: "[impit-python] Release to PyPI" permissions: - contents: write - id-token: write + contents: read on: workflow_dispatch: inputs: @@ -90,6 +89,9 @@ jobs: name: Publish runs-on: ubuntu-latest needs: [test] + permissions: + contents: read + id-token: write # Required for OIDC environment: name: pypi url: https://pypi.org/project/impit @@ -117,6 +119,8 @@ jobs: name: Generate changelog needs: [publish, get_version] runs-on: ubuntu-latest + permissions: + contents: write # Required to create the GitHub release outputs: release_body: ${{ steps.git-cliff-latest.outputs.content }} steps: