From ece2d4daa4d7d1b09e12e5cfa4b2159d9d114b19 Mon Sep 17 00:00:00 2001 From: Sal Date: Wed, 2 Sep 2026 22:16:41 +0100 Subject: [PATCH] docs(instructions): correct the workflow_call input rule Section 4 required a default on every workflow_call input. Two shipped workflows contradict that for two independently correct reasons. zsh-lint.yml declares both its inputs required, and a default on a required input is unreachable because the caller always supplies the value. commit-lint.yml declares workflow_call alongside pull_request. GitHub scopes the inputs context to a reusable or manually triggered workflow, so on a pull_request run it is empty and the declared defaults never apply. #586 removed them for that reason and moved the operative value into the job step; #597 now asserts no such default exists. Split the bullet into three clauses so the rule matches both shapes. This is a mandatory surface, so as written an agent would have edited both workflows back into defects. Closes #598 --- .../github-actions-ci-cd-best-practices.instructions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/instructions/github-actions-ci-cd-best-practices.instructions.md b/.github/instructions/github-actions-ci-cd-best-practices.instructions.md index dabc4769c..5d24c76e5 100644 --- a/.github/instructions/github-actions-ci-cd-best-practices.instructions.md +++ b/.github/instructions/github-actions-ci-cd-best-practices.instructions.md @@ -71,7 +71,9 @@ permissions: ## 4. Reusable Workflows (`workflow_call`) -- Explicitly declare `type`, `required`, and `default` for every input in `workflow_call`. +- Explicitly declare `type` and `required` for every input in `workflow_call`. +- Declare `default` only for optional inputs. A `required: true` input must not carry one, because the caller always supplies the value and the default is unreachable. +- When a workflow is **also** triggered directly (`push`, `pull_request`, `schedule`), put the operative fallback in the job step, for example `: "${VAR:=...}"`. The `inputs` context holds "the inputs of a reusable or manually triggered workflow", so on a direct trigger it is empty and `workflow_call` defaults are never applied. A default declared on the input is then dead text on the path the workflow actually takes, and an empty pattern reaching `grep -E` matches every line. - Reference called workflows using pinned immutable refs. - Expose job `outputs` cleanly for downstream dependent jobs (`needs:`).