From 92a24af7c3377a06dd3c95ac3dfabe21083a312d Mon Sep 17 00:00:00 2001 From: justinpolygon <123573436+justinpolygon@users.noreply.github.com> Date: Thu, 30 Oct 2025 15:26:02 -0700 Subject: [PATCH] Update release.yml with syntax hotfix --- .github/workflows/release.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70d87eab..c020c2ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,12 +29,24 @@ jobs: uses: abatilo/actions-poetry@v2 - name: Get package name id: package - 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 + run: | + echo "name=$(python - <<'PY' +import sys +with open('pyproject.toml', 'r', encoding='utf-8') as f: + for line in f: + s = line.strip() + if s.startswith('name'): + # supports: name="foo" or name = "foo" and ignores inline comments + val = s.split('=', 1)[1].split('#', 1)[0].strip().strip('"').strip("'") + print(val) + break +PY +)" >> "$GITHUB_OUTPUT" - name: Configure Poetry run: | - if [ "${{ steps.package.outputs.name }}" == "polygon-api-client" ]; then + if [ "${{ steps.package.outputs.name }}" = "polygon-api-client" ]; then poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD }} - elif [ "${{ steps.package.outputs.name }}" == "massive" ]; then + elif [ "${{ steps.package.outputs.name }}" = "massive" ]; then poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD_MASSIVE }} else echo "Unknown package name: ${{ steps.package.outputs.name }}; skipping publish"