Skip to content

[GitHubActions] generator: arbitrary extra with: inputs on the checkout step#431

Open
avidenic wants to merge 1 commit into
Fallout-build:mainfrom
avidenic:features/389-github-actions-checkout-with
Open

[GitHubActions] generator: arbitrary extra with: inputs on the checkout step#431
avidenic wants to merge 1 commit into
Fallout-build:mainfrom
avidenic:features/389-github-actions-checkout-with

Conversation

@avidenic

Copy link
Copy Markdown
Contributor

Closes #389.

Adds string[] CheckoutWith to GitHubActionsAttribute — an escape hatch for actions/checkout inputs the typed knobs don't cover (token, ssh-key, path, clean, persist-credentials, sparse-checkout, set-safe-directory). Each entry is emitted verbatim inside the checkout step's with: block, after the typed keys, in supply order.

[GitHubActions("build",
    GitHubActionsImage.UbuntuLatest,
    InvokedTargets = [nameof(Compile)],
    FetchDepth = 0,
    CheckoutWith = ["token: ${{ secrets.CI_PAT }}", "path: src", "persist-credentials: false"])]
- uses: actions/checkout@v6
  with:
    fetch-depth: 0
    token: ${{ secrets.CI_PAT }}
    path: src
    persist-credentials: false
  • Typed keys (submodules, lfs, fetch-depth, progress, filter, ref/repository) always emit first; CheckoutWith lines follow, in order.
  • Raw passthrough, no validation — the build author owns the YAML. This also lets multi-line block scalars work (e.g. sparse-checkout: | with continuation lines as further entries), which a KEY: value validator would reject.
  • Defaults to new string[0] and emits nothing when unset — existing workflows are byte-for-byte unchanged.

Scoped out (per the issue): the actions/checkout@v6 version override (clean additive follow-up) and post-checkout shell steps (a general step-injection mechanism, not this issue).

Tests — three Verify snapshot cases: checkout-with (typed key + the issue's example, proving ordering), checkout-with-only (guard opens with: with no typed key), checkout-with-sparse (multi-line block scalar — the case raw passthrough exists to support). No *ValidationTest.cs: the feature never throws, and the repo reserves those for validating features.


⚠️ CI note: Test is green (all test projects pass). Pack currently fails on main because CHANGELOG.md was deleted (c2cdf60) while IPack/IHasChangelog still requires it — pre-existing base-branch breakage, unrelated to this PR.

@avidenic avidenic marked this pull request as ready for review June 25, 2026 14:42
@avidenic avidenic requested a review from a team as a code owner June 25, 2026 14:42
GitHubActionsAttribute gains a string[] CheckoutWith property whose entries
are emitted verbatim inside the checkout step's with: block, after the typed
keys (submodules, lfs, fetch-depth, progress, filter, ref/repository) and in
the order supplied. This unblocks actions/checkout inputs the typed knobs
don't cover (token, ssh-key, path, clean, persist-credentials,
sparse-checkout, set-safe-directory).

Raw passthrough, no validation — the build author owns the YAML, which also
lets multi-line block scalars like `sparse-checkout: |` work, something a
KEY: value validator would reject. Defaults to an empty array and emits
nothing when unset, so existing workflows are byte-for-byte unchanged.

Closes Fallout-build#389.
@avidenic avidenic force-pushed the features/389-github-actions-checkout-with branch from a5c7b92 to 4c893ec Compare June 25, 2026 14:44
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.

[GitHubActions] generator: arbitrary extra with: inputs on the checkout step

1 participant