📖 [Docs]: Standardize separating reusable workflows from their action library#44
Draft
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Draft
Conversation
… library A shared reusable workflow ships only its own file to the caller, so a co-located ./ action cannot be resolved. Extend the GitHub Actions standard's action-vs-workflow guidance: reference actions from a shared reusable workflow by full owner/repo/path@sha, and house them either in a standalone repo (consumed alone) or a cohesive action-library repo (a set built/tested/released together, one SHA to pin) kept separate from the workflow that stitches them into a process. Ties into the Repository Segmentation shared-lifecycle principle. Companion to AI-Platform/ai-platform PR #411.
…e two lifecycle reasons Add the job.workflow_* self-checkout escape hatch (and why it is a poor foundation: GHES-unavailable, extra machinery, no independent action version line), plus the two lifecycle reasons a separately versioned action repo beats co-located local actions (development tests the branch; a release cannot pin actions to its own not-yet-existing commit). Companion to AI-Platform/ai-platform PR #411.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
There was no standard for how to split a reusable workflow from the actions
only it consumes. This documents it.
A shared reusable workflow loads only its own file into the caller's run — its
repository is not checked out — so a
./-relative action reference resolvesagainst the caller's checkout and breaks. A shared reusable workflow must
therefore reference actions by full
owner/repo/path@<sha>, which dictates wherethose actions have to live.
Changes
Coding-Standards/GitHub-Actions.md— new section "Separate a reusableworkflow from the actions it consumes" (right after "Choose an action or a
reusable workflow"):
a composite action's
./resolves within its own repo at the same ref(the asymmetry that lets a set of actions ship together);
vs an action-library repo (a cohesive set built, tested, and released
together as one package), tied into the
Repository Segmentation
shared-lifecycle principle;
Companion
Companion to AI-Platform/ai-platform#411, which adds the same standard to the
mirrored coding standards (and a matching rule in that repo's
repository-segmentation.md). MSXOrg'sRepository-Segmentation.mdalreadycarries the shared-lifecycle principle, so only the coding standard changes here.
Validation
anchor) verified to resolve.