A composite action with no steps still passes the checker #28
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions#28
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
.forgejo/scripts/check-actions.pyreports aruns:that is not a mapping, asteps:that is not a list, and any step that is not a mapping. One shape is still silent:runs: {using: composite}with nosteps:key at all passes asok (0 run step(s) checked).Raised during the review of #27 and deliberately left out of it — the reviewer named it and declined to open a third round on the same theme, which was the right call. It is a weaker case than the others: the runner rejects such an action when it loads it, so this one fails loudly at use rather than reaching a consumer looking checked. That is why it is its own small issue rather than a blocker.
Scope
Acceptance criteria
action.ymlwithruns.using: compositeand nosteps:key, when the checker runs, then it reports the action and exits non-zero.steps: [], when the checker runs, then the behaviour is whatever this issue decides — state the choice in the pull request and say why. (An empty list is a real shape; today it passes.)Picking this up. Being explicit about why, since
expiro#4is still my open issue: its pull request is complete, reviewed and parked on the runner's Docker Hub egress — everyimagejob on the fleet has failed for four hours — so there is no work left on it, only waiting. This repository's pipeline isvalidatealone and pulls no base images, so it is the one place a change can actually be finished tonight.The gap. In
check_action,stepsabsent meanssteps is not None and ...is false andisinstance(steps, list)is false, so both branches are skipped and nothing is reported.runs: {using: composite}with nosteps:therefore printsok (0 run step(s) checked).The fix is to branch on the key's presence rather than its value, which also closes
steps:written with an empty value — that lands asNonetoday and is equally silent.On the second criterion —
steps: []. I am reporting it, and the reasoning is that it is the same defect written differently: a composite action that declares no steps does nothing, and the runner rejects it either way. Two messages rather than one, so the output says which shape it found, but the same exit code. If an empty list were ever a deliberate no-op action, that would be an argument for a comment in the file rather than for the checker staying quiet.Scoped to composite actions only. A
dockerornode20action legitimately has nosteps:, so requiring them unconditionally would be wrong advice in a message. The checker already reports ausingthat is not composite, so nothing is missed by gating this on it.