docs: explain why workflow_run uses target branch definition

Added explanation of workflow_run behavior for future reference.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Gu
2025-11-06 13:05:27 -08:00
parent e219f7a223
commit efeecfb290

View File

@@ -58,3 +58,10 @@ After testing, we discovered that `workflow_run` events don't include PR informa
- **Update workflow**: Downloads artifact using `docs-sync-analysis-${{ github.event.workflow_run.id }}`
This ensures the artifact can be reliably located regardless of PR context availability.
### Why This Works
The workflow_run trigger uses the workflow definition from the **target branch** (main), not the source branch. This means:
1. Workflow fixes must be merged to main before they take effect
2. The `github.event.workflow_run.id` is always available in workflow_run context
3. Artifact naming becomes deterministic and reliable across workflow boundaries