Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] Prevent running python-release action without a specified rc version #1386

Closed
Closed
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: 18 additions & 0 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,30 @@ on:


jobs:
validate_version:
name: Validate version input
runs-on: ubuntu-latest
steps:
- name: Echo version input
run: |
echo "Version input is: ${{ github.event.inputs.version }}"

- name: Validate version input
if: ${{ github.event.inputs.version != 'main' && !contains(github.event.inputs.version, 'rc') }}
Copy link
Contributor Author

@kevinjqliu kevinjqliu Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to do this since we run on different os environments with different default shells

run: |
echo "Error: Invalid version format. You provided: '${{ github.event.inputs.version }}'"
echo "Allowed formats:"
echo " - 'main'"
echo " - version string containing 'rc' (e.g., 0.8.0rc1, 0.8.0rc2)"
exit 1

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
needs: validate_version

steps:
- uses: actions/checkout@v4
Expand Down