Skip to content

Commit 5ee57eb

Browse files
authored
[SINT-4258] Use PyPI OIDC when releasing (#2925)
* [SINT-4258] Use PyPI OIDC when releasing * [SINT-4258] Fix env name * [SINT-4258] Retrigger CI
1 parent 9cef738 commit 5ee57eb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
upload_release:
1515
name: Upload release
1616
runs-on: ubuntu-latest
17+
permissions:
18+
id-token: write
19+
environment: secure_publish_environment
1720
steps:
1821
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1922
with:
@@ -40,8 +43,12 @@ jobs:
4043
# Build a binary wheel and a source tarball
4144
python -m build --sdist --wheel --outdir dist/ .
4245
43-
- name: Publish a Python distribution to PyPI
44-
uses: pypa/gh-action-pypi-publish@release/v1
46+
# Publish wheels to PyPI using Trusted Publishers.
47+
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
48+
# This job needs to run from within the pypi-datadog-checks-base environment. PyPi
49+
# validates the workflow file name, environment and repository the request is
50+
# comming from to provide the valid JWT token.
51+
- name: Release base package to PyPI
52+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
4553
with:
46-
user: __token__
47-
password: ${{ secrets.PYPI_TOKEN }}
54+
skip-existing: true

0 commit comments

Comments
 (0)