Skip to content

Commit cae7225

Browse files
committed
ci: Set explicit permissions for CI workflow
1 parent 37b5528 commit cae7225

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ jobs:
3434
upload-name-suffix: -${{ matrix.python-version }}-${{ matrix.os }}
3535
attest-build-provenance-github: ${{ github.event_name != 'pull_request' && !github.event.pull_request.head.repo.fork }}
3636
outputs:
37-
# Outputs the supported Python versions as a JSON array, from the project classifiers
38-
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
37+
# Outputs the supported Python versions as a JSON array, from the project classifiers
38+
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
3939

4040
CI-Python:
41+
permissions:
42+
contents: read
4143
runs-on: ubuntu-latest
4244
needs: build-package
4345
env:
@@ -51,10 +53,10 @@ jobs:
5153
os: [ubuntu-latest]
5254
include:
5355
- os: macOS-latest
54-
python-version: '3.12'
56+
python-version: "3.12"
5557
pdm-version: ""
5658
- os: windows-latest
57-
python-version: '3.12'
59+
python-version: "3.12"
5860
pdm-version: ""
5961

6062
steps:
@@ -65,10 +67,10 @@ jobs:
6567
name: Setup PDM
6668
with:
6769
cache: true
68-
python-version: ${{ matrix.python-version }} # Version range or exact version of a Python version to use, the same as actions/setup-python
69-
version: ${{ matrix.pdm-version }} # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub
70-
prerelease: true # Allow prerelease versions of PDM to be installed
71-
allow-python-prereleases: true # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fall back to 3.12-dev
70+
python-version: ${{ matrix.python-version }} # Version range or exact version of a Python version to use, the same as actions/setup-python
71+
version: ${{ matrix.pdm-version }} # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub
72+
prerelease: true # Allow prerelease versions of PDM to be installed
73+
allow-python-prereleases: true # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fall back to 3.12-dev
7274
- name: Set Cache Variables
7375
id: set_variables
7476
shell: bash

0 commit comments

Comments
 (0)