Skip to content

Commit 48fab8c

Browse files
committed
ci: split publish-to-pypi and push-tag jobs
This way each job only gets the permissions it needs.
1 parent 02fde9f commit 48fab8c

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,15 @@ jobs:
3535
with:
3636
attest-build-provenance-github: 'true'
3737

38-
deploy:
38+
publish-to-pypi:
3939
if: github.repository == 'pytest-dev/pytest'
4040
needs: [package]
4141
runs-on: ubuntu-latest
4242
environment: deploy
4343
timeout-minutes: 30
4444
permissions:
4545
id-token: write
46-
contents: write
4746
steps:
48-
- uses: actions/checkout@v5
49-
with:
50-
persist-credentials: true
51-
5247
- name: Download Package
5348
uses: actions/download-artifact@v6
5449
with:
@@ -60,6 +55,18 @@ jobs:
6055
with:
6156
attestations: true
6257

58+
push-tag:
59+
needs: [publish-to-pypi]
60+
runs-on: ubuntu-latest
61+
timeout-minutes: 10
62+
permissions:
63+
contents: write
64+
steps:
65+
- uses: actions/checkout@v5
66+
with:
67+
fetch-depth: 0
68+
persist-credentials: true
69+
6370
- name: Push tag
6471
env:
6572
VERSION: ${{ github.event.inputs.version }}
@@ -105,7 +112,7 @@ jobs:
105112
retention-days: 1
106113

107114
create-github-release:
108-
needs: [generate-gh-release-notes, deploy]
115+
needs: [push-tag, generate-gh-release-notes]
109116
runs-on: ubuntu-latest
110117
timeout-minutes: 10
111118
permissions:

RELEASING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Releasing
133133

134134
Both automatic and manual processes described above follow the same steps from this point onward.
135135

136-
#. After all tests pass and the PR has been approved, trigger the ``deploy`` job
136+
#. After all tests pass and the PR has been approved, trigger the ``deploy`` workflow
137137
in https://github.com/pytest-dev/pytest/actions/workflows/deploy.yml, using the ``release-MAJOR.MINOR.PATCH`` branch
138138
as source.
139139

0 commit comments

Comments
 (0)