Skip to content

Commit cf04dbe

Browse files
committed
fix(ci): mistake in declaration -- environment belongs to workflow level not job level
1 parent d8f45d4 commit cf04dbe

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ jobs:
9595
needs: ['release','smoketest']
9696
if: (( github.event.inputs.dry_run != 'true' ) && ((github.ref_name == 'master') || startsWith(github.ref_name,'ci/') ))
9797
runs-on: ubuntu-latest
98-
environment: pypi
98+
environment:
99+
name: ( github.ref_name=='master' && 'pypi' || 'testpypi' )
100+
url: ( github.ref_name=='master' && 'https://pypi.org/project/${{ env.pypi_project }}' || 'https://test.pypi.org/project/${{ env.testpypi_project }}' )
99101
permissions:
100102
id-token: write
101103
steps:
@@ -105,15 +107,9 @@ jobs:
105107
- name: Publish to PyPI
106108
if: github.ref_name == 'master'
107109
uses: pypa/gh-action-pypi-publish@release/v1
108-
environment:
109-
name: pypi
110-
url: https://pypi.org/project/${{ env.pypi_project }}
111110

112111
- name: Publish to TestPyPI
113112
if: github.ref_name != 'master'
114113
uses: pypa/gh-action-pypi-publish@release/v1
115-
environment:
116-
name: testpypi
117-
url: https://test.pypi.org/project/${{ env.testpypi_project_name }}
118114
with:
119115
repository-url: https://test.pypi.org/uploads/legacy

0 commit comments

Comments
 (0)