refactor(generate): source action pins from an embedded manifest#398
Merged
Conversation
Move the hardcoded defaultActionPins table into a committed internal/generate/action_pins.yaml embedded with go:embed and parsed once at init. The generator pin table is built from the emit:true entries, preserving every pin value, so actionRef, cliSetupRef, and the pin-mode precedence behave identically and regenerated workflows are byte-identical. Maintainer-only actions are recorded as emit:false to keep the full pin set in one place. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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
Extracts the generator's hardcoded
defaultActionPinsmap into a committedinternal/generate/action_pins.yaml, go:embed-parsed at init. Single source of truth for every third-party action cascade pins. Anemit: true/falseflag separates the 5 generator-emitted actions from the 4 maintainer-only ones.Why
Action versions currently diverge across the generator table, the hand-written workflows, and the harness, with dependabot bumping files but not the Go map (the #272/#268 drift). This is the foundational step: a manifest the generator reads, that later PRs make dependabot-bumpable and lint-enforced.
Safety
PURE refactor, NO version-value changes. Regenerating (
generate-workflow --force) yields a BYTE-IDENTICAL.github/workflows/(empty diff). A new value-preserving test asserts the parsed table equals the prior hardcoded values exactly. go build/test, golangci-lint clean.First in a sequence (manifest -> converge -> act pin -> checkout v7 -> github-script v9 -> download v8) toward the action-pins single-source-of-truth goal.