Skip to content

Commit c4306bd

Browse files
Update release.yml with syntax hotfix (#956)
1 parent c326cf5 commit c4306bd

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,24 @@ jobs:
2929
uses: abatilo/actions-poetry@v2
3030
- name: Get package name
3131
id: package
32-
run: echo "name=$(python -c \"with open('pyproject.toml') as f: lines = f.readlines(); for line in lines: if line.strip().startswith('name ='): print(line.strip().split(' = ')[1].strip('\\\"')); break\")" >> $GITHUB_OUTPUT
32+
run: |
33+
echo "name=$(python - <<'PY'
34+
import sys
35+
with open('pyproject.toml', 'r', encoding='utf-8') as f:
36+
for line in f:
37+
s = line.strip()
38+
if s.startswith('name'):
39+
# supports: name="foo" or name = "foo" and ignores inline comments
40+
val = s.split('=', 1)[1].split('#', 1)[0].strip().strip('"').strip("'")
41+
print(val)
42+
break
43+
PY
44+
)" >> "$GITHUB_OUTPUT"
3345
- name: Configure Poetry
3446
run: |
35-
if [ "${{ steps.package.outputs.name }}" == "polygon-api-client" ]; then
47+
if [ "${{ steps.package.outputs.name }}" = "polygon-api-client" ]; then
3648
poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD }}
37-
elif [ "${{ steps.package.outputs.name }}" == "massive" ]; then
49+
elif [ "${{ steps.package.outputs.name }}" = "massive" ]; then
3850
poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD_MASSIVE }}
3951
else
4052
echo "Unknown package name: ${{ steps.package.outputs.name }}; skipping publish"

0 commit comments

Comments
 (0)