Skip to content

chore: update python-prerelease.yml#4333

Closed
hf-security-analysis[bot] wants to merge 1 commit into
mainfrom
security-fix/-github-workflows-python-prerelease-yml-1781088925
Closed

chore: update python-prerelease.yml#4333
hf-security-analysis[bot] wants to merge 1 commit into
mainfrom
security-fix/-github-workflows-python-prerelease-yml-1781088925

Conversation

@hf-security-analysis

@hf-security-analysis hf-security-analysis Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Update .github/workflows/python-prerelease.yml workflow configuration.

cc @dependabot[bot] @hanouticelina


Note

Low Risk
Changes are confined to an internal prerelease CI workflow; they add validation and reduce blast radius of automated workflow edits rather than altering runtime library code.

Overview
Hardens the Python prerelease GitHub Actions workflow that tests RC huggingface-hub builds against downstream repos.

Version handling: Tags and versions must match vX.Y.ZrcN / X.Y.ZrcN at dispatch, on tag push, and again before the PyPI wait step. The PyPI poll now strips an optional v prefix and installs huggingface-hub==… with a quoted spec.

Downstream CI edits: Instead of adding --prerelease=allow to every uv pip install under .github/workflows/, the workflow only touches workflow files that already mention huggingface-hub, with an explicit warning that this changes CI behavior.

Reviewed by Cursor Bugbot for commit a8583d1. Bugbot is set up for automated code reviews on this repo. Configure here.

@hf-security-analysis hf-security-analysis Bot requested a review from paulinebm June 10, 2026 10:55

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a8583d1. Configure here.

# Validate tag format from git ref
if [[ ! "$VERSION" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+$ ]]; then
echo "Error: Invalid tag format. Expected format: vX.Y.ZrcN or X.Y.ZrcN"
exit 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Regex rejects dotted RC tags

High Severity

The new tag regex only accepts X.Y.ZrcN (no dot before rc), but this repo’s release flow creates tags like v1.6.0.rc0. Pushes matching v*rc* fail validation and exit before RC testing runs.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a8583d1. Configure here.

# Remove 'v' prefix if present for pip
VERSION_CLEAN="${VERSION#v}"
echo "Waiting for huggingface-hub==${VERSION_CLEAN} to be available on PyPI"
while ! pip install "huggingface-hub==${VERSION_CLEAN}"; do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PyPI version not normalized

Medium Severity

VERSION_CLEAN only removes a leading v, but PyPI RC versions here use 1.6.0rc0, not 1.6.0.rc0. A dotted git tag yields a pip spec that does not match the published package name on PyPI.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a8583d1. Configure here.

# Only modify workflow files that already reference huggingface-hub to minimize scope
if grep -r "huggingface-hub" .github/workflows/ >/dev/null 2>&1; then
find .github/workflows/ -type f -exec grep -l "huggingface-hub" {} \; | xargs sed -i 's/uv pip install /uv pip install --prerelease=allow /g'
git add .github/workflows/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prerelease flag scope narrowed

Medium Severity

Only workflow files containing the literal huggingface-hub get uv pip install rewritten with --prerelease=allow. Other CI workflows that still install the pinned RC via uv pip install are left unchanged, so downstream RC test runs may not install the prerelease.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a8583d1. Configure here.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin

Wauplin commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

closing in favor of #4335 which removes the workflow file entirely

@Wauplin Wauplin closed this Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant