Skip to content

Commit 2fd75b0

Browse files
authored
Drop CI permissions, eliminate persisted credentials (psf#4905)
Signed-off-by: William Woodruff <[email protected]>
1 parent 23b8127 commit 2fd75b0

File tree

11 files changed

+43
-2
lines changed

11 files changed

+43
-2
lines changed

.github/workflows/changelog.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18+
with:
19+
persist-credentials: false
1820

1921
- name: Grep CHANGES.md for PR number
2022
if: contains(github.event.pull_request.labels.*.name, 'skip news') != true

.github/workflows/diff_shades.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ env:
1818
# binaries too).
1919
CC: clang-18
2020

21+
permissions: {}
22+
2123
jobs:
2224
configure:
2325
runs-on: ubuntu-latest
@@ -26,6 +28,8 @@ jobs:
2628

2729
steps:
2830
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
31+
with:
32+
persist-credentials: false
2933

3034
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
3135
with:
@@ -57,6 +61,7 @@ jobs:
5761
with:
5862
# The baseline revision could be rather old so a full clone is ideal.
5963
fetch-depth: 0
64+
persist-credentials: false
6065

6166
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
6267
with:
@@ -110,6 +115,7 @@ jobs:
110115
with:
111116
# The baseline revision could be rather old so a full clone is ideal.
112117
fetch-depth: 0
118+
persist-credentials: false
113119

114120
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
115121
with:
@@ -172,6 +178,8 @@ jobs:
172178

173179
steps:
174180
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
181+
with:
182+
persist-credentials: false
175183

176184
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
177185
with:

.github/workflows/diff_shades_comment.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ on:
55
workflows: [diff-shades]
66
types: [completed]
77

8-
permissions:
9-
pull-requests: write
8+
permissions: {}
109

1110
jobs:
1211
comment:
1312
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
1415
steps:
1516
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17+
with:
18+
persist-credentials: false
1619
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
1720
with:
1821
python-version: "3.13"

.github/workflows/doc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
runs-on: ${{ matrix.os }}
2828
steps:
2929
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
30+
with:
31+
persist-credentials: false
3032

3133
- name: Set up latest Python
3234
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0

.github/workflows/docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
with:
21+
persist-credentials: false
2022

2123
- name: Set up QEMU
2224
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0

.github/workflows/fuzz.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535

3636
steps:
3737
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
38+
with:
39+
persist-credentials: false
3840

3941
- name: Set up Python ${{ matrix.python-version }}
4042
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Lint + format ourselves
22

33
on: [push, pull_request]
44

5+
permissions: {}
6+
57
jobs:
68
build:
79
# We want to run on external PRs, but not on our own internal PRs as they'll be run
@@ -15,6 +17,8 @@ jobs:
1517

1618
steps:
1719
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
with:
21+
persist-credentials: false
1822

1923
- name: Assert PR target is main
2024
if: github.event_name == 'pull_request' && github.repository == 'psf/black'

.github/workflows/pypi_upload.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22+
with:
23+
persist-credentials: false
2224

2325
- name: Set up latest Python
2426
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -47,6 +49,8 @@ jobs:
4749
include: ${{ steps.set-matrix.outputs.include }}
4850
steps:
4951
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
52+
with:
53+
persist-credentials: false
5054
# Keep cibuildwheel version in sync with below
5155
- name: Install cibuildwheel and pypyp
5256
run: |
@@ -94,6 +98,8 @@ jobs:
9498

9599
steps:
96100
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
101+
with:
102+
persist-credentials: false
97103
# Keep cibuildwheel version in sync with above
98104
- uses: pypa/cibuildwheel@63fd63b352a9a8bdcc24791c9dbee952ee9a8abc # v3.3.0
99105
with:
@@ -125,6 +131,7 @@ jobs:
125131
with:
126132
ref: stable
127133
fetch-depth: 0
134+
persist-credentials: true # needed for `git push` below
128135

129136
- if: github.event_name == 'release'
130137
name: Update stable branch to release tag & push

.github/workflows/release_tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
- release.py
1313
- release_tests.py
1414

15+
permissions: {}
16+
1517
jobs:
1618
build:
1719
# We want to run on external PRs, but not on our own internal PRs as they'll be run
@@ -33,6 +35,7 @@ jobs:
3335
with:
3436
# Give us all history, branches and tags
3537
fetch-depth: 0
38+
persist-credentials: false
3639
- name: Set up Python ${{ matrix.python-version }}
3740
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
3841
with:

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242

4343
steps:
4444
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
45+
with:
46+
persist-credentials: false
4547

4648
- name: Set up Python ${{ matrix.python-version }}
4749
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -83,6 +85,8 @@ jobs:
8385
runs-on: ubuntu-latest
8486
steps:
8587
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
88+
with:
89+
persist-credentials: false
8690
- name: Send finished signal to Coveralls
8791
uses: AndreMiras/coveralls-python-action@ac868b9540fad490f7ca82b8ca00480fd751ed19
8892
with:
@@ -101,6 +105,8 @@ jobs:
101105

102106
steps:
103107
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
108+
with:
109+
persist-credentials: false
104110

105111
- name: Set up latest Python
106112
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0

0 commit comments

Comments
 (0)