Skip to content

Conversation

@shivasurya
Copy link
Owner

Summary

Restricts the PyPI publishing workflow to run only on two specific events:

  1. Release published (not drafts) - using release: types: [published]
  2. Manual workflow dispatch - via GitHub UI with version input

Why this change?

Currently the workflow runs on push: tags: v* which triggers on ANY tag push. This can lead to unintended PyPI publishes.

Changes

  • Removed: push: tags: v* trigger
  • Added: release: types: [published] trigger
  • Kept: workflow_dispatch manual trigger
  • Updated: Version extraction logic to read from github.event.release.tag_name
  • Improved: Error handling when no version source is available

New Behavior

Option 1: Release Published (Automatic)

When you publish a release on GitHub, the workflow automatically triggers and publishes to PyPI.

Option 2: Manual Trigger (Override)

From GitHub Actions UI, navigate to Actions → Publish to PyPI → Run workflow with version number.

Benefits

  • No accidental publishes from tag pushes
  • Releases can be prepared as drafts without triggering publish
  • Manual override available when needed
  • Clear error messages if triggered incorrectly

🤖 Generated with Claude Code

Changes the PyPI publishing workflow to run only on:
1. Release published events (not drafts) - using 'release: types: [published]'
2. Manual workflow_dispatch with version input

Removes the 'push: tags:' trigger that ran on any tag push.

This provides better control over when PyPI packages are published:
- Releases can be prepared as drafts without triggering publish
- Only finalized releases trigger automatic publishing
- Manual override available via workflow_dispatch when needed

Updated version detection logic:
- Extracts version from github.event.release.tag_name for releases
- Strips 'v' prefix if present
- Falls back to workflow_dispatch version input
- Errors if neither source is available

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@shivasurya shivasurya added the enhancement New feature or request label Jan 20, 2026
@shivasurya shivasurya self-assigned this Jan 20, 2026
@safedep
Copy link

safedep bot commented Jan 20, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.94%. Comparing base (18540ff) to head (7f5ff5c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #477   +/-   ##
=======================================
  Coverage   79.94%   79.94%           
=======================================
  Files         101      101           
  Lines       11107    11107           
=======================================
  Hits         8880     8880           
  Misses       1879     1879           
  Partials      348      348           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya shivasurya merged commit 548a8d9 into main Jan 20, 2026
7 checks passed
@shivasurya shivasurya deleted the fix/pypi-publish-triggers branch January 20, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants