Skip to content

Fix pypi-publish workflow to handle manual triggers#26

Merged
digreatbrian merged 2 commits intomainfrom
copilot/fix-pypi-publish-condition
Feb 16, 2026
Merged

Fix pypi-publish workflow to handle manual triggers#26
digreatbrian merged 2 commits intomainfrom
copilot/fix-pypi-publish-condition

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 16, 2026

The pypi-publish.yml workflow failed when manually triggered via workflow_dispatch because it unconditionally referenced github.event.workflow_run, which only exists for workflow_run triggers.

Changes

  • test-testpypi-installation job: Added github.event_name != 'workflow_dispatch' guard to skip TestPyPI verification when manually triggered (package won't exist yet)
  • build job: Added always() condition with explicit result checks to run when test job succeeds or is skipped, but not when failed
  • checkout step: Made ref conditional to use github.event.workflow_run.head_sha for workflow_run events and github.ref for manual triggers

Behavior

workflow_run trigger: Test TestPyPI installation → Build → Publish to PyPI
workflow_dispatch trigger: Skip test → Build → Publish to PyPI

# Before
if: ${{ github.event.workflow_run.conclusion == 'success' }}

# After  
if: ${{ github.event_name != 'workflow_dispatch' && github.event.workflow_run.conclusion == 'success' }}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: digreatbrian <119015367+digreatbrian@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pypi-publish.yml condition for non-manual triggers Fix pypi-publish workflow to handle manual triggers Feb 16, 2026
Copilot AI requested a review from digreatbrian February 16, 2026 17:11
@digreatbrian digreatbrian marked this pull request as ready for review February 16, 2026 17:14
@digreatbrian digreatbrian merged commit 8e9610e into main Feb 16, 2026
4 checks passed
@digreatbrian digreatbrian deleted the copilot/fix-pypi-publish-condition branch February 16, 2026 17:15
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.

2 participants