Repository navigation
fix(generator): support with: on uses setup steps - #282
Merged
Merged
Conversation
Actions that take parameters (e.g. `actions/setup-node@v4` with
`node-version-file`) previously had to be expressed as `raw` YAML.
`_setup_yaml()` can't add the `if:` guard to raw steps, so when the
notifications workflow's pre-check decided to skip (no notifications to
process), the raw setup-node step still ran — and failed with "The
specified node version file does not exist" because checkout was
skipped.
Accept `with = {...}` alongside `uses` in `[[setup]]`, render it as a
nested YAML block, and keep the `if:` guard. Reject `with` on `run`/`raw`
steps with a clear error.
Closes #281
Co-Authored-By: Claude <[email protected]>
Merged
max-sixty
added a commit
that referenced
this pull request
Apr 15, 2026
Bumps generator version to 0.0.13 and syncs lockfile. 6 commits since 0.0.12: - fix(generator): support `with:` on `uses` setup steps (#282) - fix(release): regenerate tend's own workflows after PyPI release (#275) - docs: explain workflow overrides and test skip-review-label example (#277) - docs(readme): note on Claude subscription & OAuth tokens (#272) - skills(review-reviewers): document bot-self-trigger as non-issue (#271) - chore: regenerate workflows with tend 0.0.12 (#273) > _This was written by Claude Code on behalf of Maximilian_ Co-authored-by: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Apr 15, 2026
Previously `[[setup]]` entries were constrained to `{uses, with}`,
`{run}`, or `{raw}`. Needing `env`, `name`, `shell`, or
`working-directory` forced a drop to `raw`, which can't receive the
`if:` guard injected in `tend-notifications` — so those steps ran even
when the pre-check decided to skip, which is the same bug class that
motivated #282.
Generalize by letting a structured step carry any field from GitHub's
step schema: `uses`, `run`, `name`, `id`, `if`, `with`, `env`, `shell`,
`working-directory`, `continue-on-error`, `timeout-minutes`. Unknown
keys fail at config-load with a message listing what's allowed, so
typos surface immediately instead of at workflow-parse time.
`raw` stays as the escape hatch for emitting multiple steps from one
entry. A user-supplied `if:` on a structured step is passed through
unchanged in notifications — tend does not stack its guard on top; a
warning makes that explicit.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Apr 15, 2026
## Problem
Previously `[[setup]]` entries were constrained to `{uses, with}`,
`{run}`, or `{raw}`. Needing `env`, `name`, `shell`, or
`working-directory` forced a drop to `raw`, which can't receive the
`if:` guard injected in `tend-notifications` — so those steps ran even
when the pre-check decided to skip. This is the same bug class #282
fixed for `with`, just narrower in scope.
## Solution
Let a structured `[[setup]]` entry carry any field from GitHub's step
schema: `uses`, `run`, `name`, `id`, `if`, `with`, `env`, `shell`,
`working-directory`, `continue-on-error`, `timeout-minutes`. Unknown
keys fail at config-load with a message listing what's allowed, so typos
surface immediately instead of at workflow-parse time.
```toml
[[setup]]
uses = "actions/setup-node@v4"
name = "Setup Node"
with = { node-version-file = ".node-version" }
env = { FORCE_COLOR = "1" }
[[setup]]
run = "cargo build --release"
shell = "bash"
working-directory = "./crates/core"
env = { RUSTFLAGS = "-D warnings" }
```
`raw` stays as the escape hatch for emitting multiple steps from one
entry. A user-supplied `if:` on a structured step is passed through
unchanged in notifications — tend does not stack its guard on top, and
emits a warning making that explicit.
## Testing
- New tests: passthrough for `env`/`name`/`shell`/`working-directory`;
user-supplied `if:` preserved + warning; unknown fields rejected; `env`
must be a table. The existing `with` test still passes.
- Full suite: 165 passed.
- `pre-commit run` clean.
## Not touching
Tend's own `.github/workflows/tend-*.yaml` — per `CLAUDE.md`, those
track the latest published release and regenerate nightly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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.
Problem
The
tend-notificationsworkflow fails when there are no notifications to process and the repo configures a parameterized setup action likeactions/setup-node@v4._setup_yaml()only adds theif:guard tousesandrunstep types. Arawstep gets rendered verbatim (by design — it's verbatim YAML), which means actions that needwith:parameters — forced intorawbecause the oldusesstep type didn't supportwith— run even when the pre-check decided to skip. With checkout also skipped,.node-versiondoesn't exist and setup-node fails.Solution
Accept
with = {...}alongsideusesin[[setup]]and render it as a nested YAML block. This lets parameterized actions use theusesstep type and receive theif:guard normally:withonrun/rawsteps is rejected with a clear error.rawis still supported for fall-back cases (injecting multiple steps, step-levelshell:/env:), and the example config now nudges towarduses+withfor anything it can express.Testing
test_setup_uses_with_parameters_gets_if_guardreproduces the bug: before the fix it assertedNone == {'node-version-file': '.node-version'}because thewithkey was silently dropped by the config parser. It now passes and also confirms the rendered step has theif:guard.pre-commit runclean on touched files.Not touching
Tend's own
.github/workflows/tend-*.yaml— perCLAUDE.md, those track the latest published release and regenerate nightly. The gap between this generator change and the next release is expected.Closes #281 — automated triage