Skip to content

📖 [Docs]: Reusable workflows with co-located composite actions#45

Merged
Marius Storhaug (MariusStorhaug) merged 3 commits into
mainfrom
docs/reusable-workflows-guidance
Jul 16, 2026
Merged

📖 [Docs]: Reusable workflows with co-located composite actions#45
Marius Storhaug (MariusStorhaug) merged 3 commits into
mainfrom
docs/reusable-workflows-guidance

Conversation

@MariusStorhaug

Copy link
Copy Markdown
Member

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.

@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review July 16, 2026 19:39
@MariusStorhaug Marius Storhaug (MariusStorhaug) merged commit 1662610 into main Jul 16, 2026
19 checks passed
@MariusStorhaug Marius Storhaug (MariusStorhaug) deleted the docs/reusable-workflows-guidance branch July 16, 2026 19:40
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.

1 participant