CI/CD container release gate
returns every applicable code 2 marksDecide whether a CI run may promote a container image, and prove it with a real workflow. This is the one question with two graded halves: the live probes carry most of it, the public workflow evidence carries the rest.
Collect, don't short-circuit. Unlike the other gates, this one wants all the violation codes for a payload. Build a list, append as you go, de-duplicate at the end, and promote only when the list is empty.
Permissions are set equality, not a subset check. Compare the whole permissions object against the exact required scopes. An extra scope, a missing scope, or a right key with a wrong value are all the same single violation.
The unsafe trigger is a fixed value. One specific trigger is never acceptable for a release gate; flag it whenever it appears rather than trying to infer intent from the event field. Don't over-fire on a merely mismatched event — that isn't the violation being tested.
Three test conditions collapse into one code. Tests passing, the matrix completing, and fail-fast being off are separate booleans but a single violation. Any one of them failing emits it once.
Pinning applies only to third parties. Actions under the first-party namespace may use a version tag. Everything else must match a full 40-character lowercase hex SHA — anchor the regex at both ends so a 39- or 41-character string fails.
The image checks are five independent gates. Build style, runtime user, how the build secret was supplied, critical vulnerability count, and digest pinning each emit their own code and can fire together.
Production adds two more, not one. The branch and event requirement is one code; the missing approval flag is a different code. A production payload can trip both at once.
Then build the evidence. Public repository, a workflow whose
name:matches the required string character for character, a step whosename:matches its required string character for character, triggered on a push to the default branch, and actually run green. Submit the workflow page URL — the one that lists runs — not the URL of an individual run.
Where people lose it
- An uppercase SHA. The spec says lowercase hexadecimal. A regex that accepts
A-Fsilently passes a payload that should fail. - Missing fields treated as passing. An absent vulnerability count or digest flag is a violation, not a default.
- Submitting a run URL. The backend reads the workflow file and the branch status badge from the workflow page. A run URL fails that read even though the run is green.
- A name that is close. Extra spacing or different capitalisation in the workflow or step name is a miss. Copy the strings, don't retype them.