Commit 1662610
authored
📖 [Docs]: Reusable workflows with co-located composite actions (#45)
Reusable workflows that have co-located composite actions can now be
correctly documented. This guide explains how to structure a reusable
workflow so that its own composite actions are found and executed
correctly, regardless of whether the workflow is invoked on a tagged
release or a development branch.
The pattern uses `job.workflow_repository` and `job.workflow_sha`
context variables (available on GitHub.com and GitHub Enterprise Cloud)
to ensure the reusable workflow checks itself out before calling any
local actions — avoiding the common pitfall where action paths resolve
to the caller's repository instead of the workflow's own repository.
## Technical Details
Added a new section "Reusable workflows with co-located composite
actions" to `src/docs/Coding-Standards/GitHub-Actions.md`:
- Explains the problem: reusable workflows run in the caller's
workspace, so relative action paths resolve to the wrong repository
- Provides the solution: use `job.workflow_repository` and
`job.workflow_sha` to self-checkout the reusable workflow first
- Includes a complete YAML example showing the pattern
- Documents availability on GitHub.com and GHEC (not available on GHES)
Aligns with the same section added to AI-Platform documentation to
ensure consistency across organizations.1 parent f527e23 commit 1662610
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
616 | | - | |
| 616 | + | |
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
| 631 | + | |
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| |||
0 commit comments