You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A convention test holds every piped run: script of a workflow to pipefail #160
pipefail is in effect when one of these is true of the step:
the workflow sets defaults: run: shell: bash (bash --noprofile --norc -eo pipefail {0}), and neither the job's defaults nor the step's own shell: puts another shell in its place. This is what dotnet.yml has from fix: a failing test fails the Test and Integration tests steps #158 and release.yml had before it;
A workflow that is called takes nothing from its caller: release.yml sets the default, and the lanes of dotnet.yml it calls ran as bash -e {0} all the same (the second run above). So the rule is asked of each file by itself.
Where it goes
test/CodoMetis.EFCore.SchemaKit.Tests/Conventions/WorkflowGateConventionTests.cs, beside the tests of the gate, read through Harness/WorkflowFile.cs. Both arrive with #154 and are not on main yet, which is why this was not written with #158. A lane that cannot fail is the same decay as a lane the gate does not need: the gate sees success.
Over WorkflowFile.All(), so that nightly.yml (#154) and a workflow added later are held to it as well.
Done when
The test is on main and has been seen to fail each way the rule can break: the defaults: block taken out of dotnet.yml, a step given a shell: of its own without pipefail, a job given defaults that take it away.
A note from #154, for whoever writes this test. I am not taking the issue over.
#154 changed Harness/WorkflowFile.cs on the way (branch chore/35-port-conventions, b0e5e0d, not merged yet), and part of what this test needs is in it now.
What is there
Pipefail(job, step) says whether a step runs with pipefail, by the shell it is given: the step's own shell:, else the job's defaults: run: shell, else the workflow's. The nearest of the three decides, bash is true and no shell is false. It reads one file by itself, so a called workflow takes nothing from its caller. That is the first bullet of "What it holds".
WorkflowFile.All() and Jobs, and WorkflowFile.Parse(fileName, text) for a workflow written in a test. WorkflowFileTests has one that states a shell in each of the three places, and shows false | cat leaving 0 without pipefail and 1 with it.
A job is read whatever stands behind its key, and one this reader cannot read fails the load. So "over WorkflowFile.All()" passes over no job.
What is not, and this test needs
A way to every step. Step, Run and Pipefail find a step by its name:. pr-hygiene.yml has a step that is - run: with no name, and no defaults, so it runs as bash -e.
A script that is not a run: | block. Run reads that form alone; dotnet.yml and release.yml have three one-line run: steps and one folded run: >.
An answer for another shell. Pipefail fails on a shell: that is not bash ("these tests run a step with bash") and does not say false. The second break of "Done when", a step given a shell: of its own without pipefail, needs false there.
The second bullet of "What it holds": nothing reads a script for set -o pipefail before its first pipe.
One thing the rule may want to say: the nameless step of pr-hygiene.yml calls .github/scripts/pr-hygiene.sh, so its run: has no pipe and the script it calls pipes in two places. That script sets set -euo pipefail itself.
Activity
CaffeinatedCoder commentedon Nov 16, 2026
A note from #154, for whoever writes this test. I am not taking the issue over.
#154 changed
Harness/WorkflowFile.cson the way (branchchore/35-port-conventions, b0e5e0d, not merged yet), and part of what this test needs is in it now.What is there
Pipefail(job, step)says whether a step runs withpipefail, by the shell it is given: the step's ownshell:, else the job'sdefaults: run: shell, else the workflow's. The nearest of the three decides,bashis true and no shell is false. It reads one file by itself, so a called workflow takes nothing from its caller. That is the first bullet of "What it holds".RunStepasks it, so the tests of test: the rest of the 5.x port: convention tests, nightly.yml, the SBOMs and the skills #154 that run a step's lines run them as a runner does:bash -ewhere no shell is stated,bash --noprofile --norc -eo pipefailwhere it is. Rebased ontomainwith fix: a failing test fails the Test and Integration tests steps #158, the gate's script runs withpipefail.WorkflowFile.All()andJobs, andWorkflowFile.Parse(fileName, text)for a workflow written in a test.WorkflowFileTestshas one that states a shell in each of the three places, and showsfalse | catleaving 0 withoutpipefailand 1 with it.WorkflowFile.All()" passes over no job.What is not, and this test needs
Step,RunandPipefailfind a step by itsname:.pr-hygiene.ymlhas a step that is- run:with no name, and nodefaults, so it runs asbash -e.run: |block.Runreads that form alone;dotnet.ymlandrelease.ymlhave three one-linerun:steps and one foldedrun: >.Pipefailfails on ashell:that is notbash("these tests run a step with bash") and does not say false. The second break of "Done when", a step given ashell:of its own withoutpipefail, needs false there.set -o pipefailbefore its first pipe.One thing the rule may want to say: the nameless step of
pr-hygiene.ymlcalls.github/scripts/pr-hygiene.sh, so itsrun:has no pipe and the script it calls pipes in two places. That script setsset -euo pipefailitself.