fix: reject timeout_minutes on reusable-workflow callbacks - #173
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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
A per-callback
timeout_minuteson a build, deploy, or validate callback produced an invalid workflow. cascade callbacks are reusable-workflow only, so every callback is emitted as ajobs.<id>.usescaller job. Config validation did not rejecttimeout_minutes, and the retry-shim emit path still wrote atimeout-minutes:line on theuses:job, so generation could silently emit YAML that GitHub rejects at parse time.GitHub Actions semantics
A job that calls a reusable workflow (
jobs.<id>.uses) may only set:uses,with,secrets,needs,if,permissions,strategy,name, andconcurrency.timeout-minutesis forbidden on such a job; it must be declared inside the called workflow. This rule was already documented in the codebase for the main caller job and forruns_on/concurrency;timeout_minuteswas the missing case.Fix
timeout_minuteson reusable-workflow callbacks (builds, deploys, validate) via a newvalidateCallbackTimeout, mirroring the existingruns_on/concurrencyrejection. The error points the operator to settimeout-minutesinside the callback workflow.timeout-minutes:on the retry-shimuses:job. TheTimeoutMinutesfield is kept onCallbackInfoas validated-against-but-never-emitted, matching howruns_on/concurrencyare handled.job_timeout_minutes(cascade-owned job timeout) is unchanged and still emitted on owned jobs.Verification
go build ./...: successgo test ./...: 1355 passed in 23 packagesgo vet ./...: no issuesgolangci-lint run ./...: no issuesjob_timeout_minutes) that must stay clean.Do not merge yet.