Skip to content

Commit

Permalink
Remove excessive permissions in GA (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede authored Jan 21, 2025
1 parent db5fa86 commit 00303f0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/macos-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
- python-version: "3.11"
torch-version: "1.13.1"

permissions:
contents: read

runs-on: ${{ matrix.os }}

defaults:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/macos-x86.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
- python-version: "3.11"
torch-version: "1.13.1"

permissions:
contents: read

runs-on: ${{ matrix.os }}

defaults:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ on:

jobs:
wheel:
permissions:
contents: read

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -45,7 +49,11 @@ jobs:
path: dist/*.whl

sdist:
permissions:
contents: read

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -62,10 +70,15 @@ jobs:

upload_test_pypi:
needs: [sdist, wheel]

runs-on: ubuntu-latest

environment: release

permissions:
contents: read
id-token: write

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download build artifacts
Expand All @@ -81,10 +94,15 @@ jobs:

upload_pypi:
needs: [sdist, wheel, upload_test_pypi]

runs-on: ubuntu-latest

environment: release

permissions:
contents: read
id-token: write

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download build artifacts
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ jobs:

runs-on: ${{ matrix.os }}

permissions:
contents: read

defaults:
run:
shell: bash {0}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
- python-version: "3.8"
torch-version: "2.5.1"

permissions:
contents: read

runs-on: ${{ matrix.os }}

defaults:
Expand Down

0 comments on commit 00303f0

Please sign in to comment.