Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/release-pypi-build-push-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
default: ""
required: false

# Read-only GITHUB_TOKEN: the job only checks out and uploads to PyPI with PYPI_TOKEN
permissions:
contents: read

jobs:
build_push:
runs-on: ubuntu-latest
Expand All @@ -35,13 +39,21 @@ jobs:
poetry install --with=dev

- name: bump_test_version
# The input goes through an env var, not ${{ }} in the script, so it can't inject shell code
env:
VERSION: ${{ github.event.inputs.version }}
run: |
if [ -z "${{ github.event.inputs.version }}" ]; then
if [ -z "$VERSION" ]; then
echo "No version input provided, running without RELEASE_VERSION."
make bump-test-version
else
echo "Version input provided: ${{ github.event.inputs.version }}"
make bump-test-version RELEASE_VERSION=${{ github.event.inputs.version }}
echo "Version input provided: $VERSION"
# make expands RELEASE_VERSION too ($(shell ...) would run), so only a well-formed version reaches it
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+$ ]]; then
echo "[ERROR] Invalid format for version input. Expected format: 9.9.9-rc9" >&2
exit 1
fi
make bump-test-version RELEASE_VERSION="$VERSION"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
fi
shell: bash

Expand Down
Loading