@@ -22,13 +22,18 @@ defaults:
2222 run :
2323 shell : bash
2424
25+ # Default to no permissions; each job opts in to exactly what it needs.
26+ permissions : {}
27+
2528env :
2629 FORCE_COLOR : " 1"
2730
2831jobs :
2932 pre-commit :
3033 name : Pre-commit checks
31- uses : beeware/.github/.github/workflows/pre-commit-run.yml@main
34+ permissions :
35+ contents : read
36+ uses : beeware/.github/.github/workflows/pre-commit-run.yml@66283ddb9e206f93b423118deecf1caf516078c1 # main
3237 with :
3338 pre-commit-source : " pre-commit"
3439
@@ -37,35 +42,34 @@ jobs:
3742 name : Build wheels
3843 runs-on : macos-latest
3944 permissions :
40- # Required by attest-build-provenance to mint a Sigstore signing
41- # certificate via OIDC; only granted to this job, not the workflow.
4245 id-token : write
4346 attestations : write
4447 contents : read
4548 steps :
4649 - name : Checkout
47- uses : actions/checkout@v6.0.2
50+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4851 with :
4952 fetch-depth : 0
53+ persist-credentials : false
5054
5155 - name : Set up Python
52- uses : actions/setup-python@v6.2.0
56+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5357 with :
5458 python-version : " 3.x"
5559
5660 - name : Build wheels
57- uses : pypa/cibuildwheel@v3.4.1
61+ uses : pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
5862 with :
5963 output-dir : dist
6064
6165 - name : Generate build provenance attestation for wheels
6266 if : inputs.attest-package == 'true'
63- uses : actions/attest-build-provenance@v4
67+ uses : actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4
6468 with :
6569 subject-path : " dist/*.whl"
6670
6771 - name : Upload artefacts
68- uses : actions/upload-artifact@v4
72+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
6973 with :
7074 name : dist-wheels
7175 path : ./dist/*.whl
@@ -81,12 +85,13 @@ jobs:
8185 contents : read
8286 steps :
8387 - name : Checkout
84- uses : actions/checkout@v6.0.2
88+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8589 with :
8690 fetch-depth : 0
91+ persist-credentials : false
8792
8893 - name : Set up Python
89- uses : actions/setup-python@v6.2.0
94+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
9095 with :
9196 python-version : " 3.x"
9297
@@ -97,12 +102,12 @@ jobs:
97102
98103 - name : Generate build provenance attestation for sdist
99104 if : inputs.attest-package == 'true'
100- uses : actions/attest-build-provenance@v4
105+ uses : actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4
101106 with :
102107 subject-path : " dist/*.tar.gz"
103108
104109 - name : Upload artefacts
105- uses : actions/upload-artifact@v4
110+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
106111 with :
107112 name : dist-sdist
108113 path : ./dist/*.tar.gz
@@ -112,23 +117,26 @@ jobs:
112117 name : Test (${{ matrix.python-version }})
113118 needs : build-wheels
114119 runs-on : macos-latest
120+ permissions :
121+ contents : read
115122 strategy :
116123 fail-fast : false
117124 matrix :
118125 python-version : ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
119126 steps :
120127 - name : Checkout
121- uses : actions/checkout@v6.0.2
128+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
122129 with :
123130 fetch-depth : 0
131+ persist-credentials : false
124132
125133 - name : Set up Python
126- uses : actions/setup-python@v6.2.0
134+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
127135 with :
128136 python-version : ${{ matrix.python-version }}
129137 allow-prereleases : true
130138
131- - uses : actions/download-artifact@v4
139+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
132140 with :
133141 name : dist-wheels
134142 path : wheelhouse
0 commit comments