Skip to content

Commit 5cc18c2

Browse files
[FIX] Trigger publish workflow from auto-release (#21) (#22)
## Description Fix the auto-publish chain where `publish.yml` was not triggered after `auto-release.yml` created a GitHub release. This is because GitHub Actions events created by `GITHUB_TOKEN` don't trigger other workflows, but `workflow_dispatch` is an exception to this limitation. ## Type of Change - [x] Bug fix ## Changes Made - Added `workflow_dispatch:` trigger to `publish.yml` so it can be invoked via `gh workflow run` - Added a "Trigger publish workflow" step in `auto-release.yml` that runs `gh workflow run publish.yml` after creating a release, using the same condition (`steps.check_tag.outputs.exists == 'false'`) ## Related Issues Closes #21 ## Testing - [x] Manual review of workflow YAML syntax - [x] Verified the `workflow_dispatch` trigger is a known exception to the GITHUB_TOKEN limitation ## Checklist - [x] My code follows the project's code style - [x] I have performed a self-review of my code - [x] My changes generate no new warnings Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 39792b8 commit 5cc18c2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/auto-release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ jobs:
3434
tag_name: v${{ steps.version.outputs.version }}
3535
name: v${{ steps.version.outputs.version }}
3636
generate_release_notes: true
37+
- name: Trigger publish workflow
38+
if: steps.check_tag.outputs.exists == 'false'
39+
env:
40+
GH_TOKEN: ${{ github.token }}
41+
run: |
42+
gh workflow run publish.yml
43+
echo "✅ Publish workflow triggered"

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Publish to PyPI
33
on:
44
release:
55
types: [published]
6+
workflow_dispatch:
67

78
permissions:
89
id-token: write

0 commit comments

Comments
 (0)