Add a typed step-injection pipeline to the GitHub Actions generator#475
Open
avidenic wants to merge 3 commits into
Open
Add a typed step-injection pipeline to the GitHub Actions generator#475avidenic wants to merge 3 commits into
avidenic wants to merge 3 commits into
Conversation
Introduce the public surface a build uses to inject custom workflow steps: GitHubActionsCustomStep (uses:/run: with fixed-order YAML rendering), GitHubActionsStepPosition (PostCheckout/PreRun/PostRun/JobEnd), the IConfigureGitHubActions hook interface, and GitHubActionsStepPipeline (per-job context + Insert + read-only BuiltInSteps view). Expose Fallout.Common internals to Fallout.Common.Specs so the pipeline's generator-only surface stays internal but testable.
Refactor GitHubActionsAttribute.GetSteps to assemble the base step sequence, hand it to a per-job GitHubActionsStepPipeline as read-only BuiltInSteps, query Build for IConfigureGitHubActions, validate the collected inserts, then splice them in at their anchor positions (call order preserved). Validation fails the build on an invalid step: exactly one of Uses/Run, With requires Uses, Shell only on a run step. A build not implementing the interface, or one that inserts nothing, yields byte-identical YAML.
Read the Write flow top-down; the Scalar/MapBlock local functions that close over the list-marker flag now sit at the end. Behaviour is unchanged.
IT-VBFK
reviewed
Jul 10, 2026
Comment on lines
+34
to
+38
| yaml.Should().Be( | ||
| "- name: Setup Node\n" + | ||
| " uses: actions/setup-node@v4\n" + | ||
| " with:\n" + | ||
| " node-version: 20\n"); |
There was a problem hiding this comment.
Suggested change
| yaml.Should().Be( | |
| "- name: Setup Node\n" + | |
| " uses: actions/setup-node@v4\n" + | |
| " with:\n" + | |
| " node-version: 20\n"); | |
| yaml.Should().Be( | |
| """ | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| """); |
I vote for string literal in general, like so
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.
Closes #456.
Problem
GitHubActionsAttribute.GetSteps()yields a fixed, closed step sequence with no hook points and isprivate. No way to inject a marketplace action or custom shell step at a chosen position.Outcome
A build implements
IConfigureGitHubActions.ConfigureSteps(GitHubActionsStepPipeline)to inject typeduses:/run:steps at four named positions — compile-checked, no reflection.New public types:
GitHubActionsCustomStep,GitHubActionsStepPosition(PostCheckout/PreRun/PostRun/JobEnd),IConfigureGitHubActions,GitHubActionsStepPipeline.Notes
Uses/Run;WithrequiresUses;Shellonly on a run step.BuiltInStepsview — deliberately composes with the [GitHubActions] generator: emit CD pipelines (or a thin shell delegating to dotnet fallout Deploy) #336 job-DAG work rather than being reworked by it. Job-level concerns (needs:/outputs:/env gates) are out of scope for [GitHubActions] generator: emit CD pipelines (or a thin shell delegating to dotnet fallout Deploy) #336.[GitHubActionsInput]'s validation style.Acceptance criteria
uses:/run:at each of the four positions; multiple inserts at one position render in call order.ArgumentException.WorkflowName/Image(no per-step scoping arrays).Verification
Full
Fallout.Common.Specssuite: 114 passed, 7 skipped, 0 failed. Zero snapshot churn. Full-solution build clean.