Skip to content

Commit 25723cb

Browse files
authored
Update python-publish.yml
1 parent c28ee59 commit 25723cb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/python-publish.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ jobs:
4949
with:
5050
name: python-package-distributions
5151
path: dist/
52+
- name: Set environment based on branch
53+
id: identify
54+
run: |
55+
echo "git log -1 --format='%D' ${{ github.ref }} | grep -Eo '[^\/]+$'" >> $BRANCH
56+
echo $BRANCH
57+
echo "branch_name=${BRANCH}" >> $GITHUB_OUTPUT
58+
outputs:
59+
branch_name: ${{ steps.identify.outputs.branch_name }}
60+
5261

5362
publish-to-pypi:
5463
name: publish python distribution to PyPi based on environment
@@ -57,7 +66,7 @@ jobs:
5766
runs-on: ubuntu-latest
5867

5968
environment:
60-
name: ${{ github.ref }}
69+
name: ${{ needs.build.outputs.branch_name }}
6170
url: ${{ vars.PYPI_URL }}
6271

6372
permissions:

0 commit comments

Comments
 (0)