fix(actions): cap dynamic matrix expansion at MaxJobNumPerRun

A matrix built from a dependent job's runtime output (fromJson(needs.*.outputs.*))
has no inherent size bound, so a large or buggy upstream output could insert an
arbitrary number of jobs in one transaction. The per-attempt AttemptJobIDs also
back the job-index URLs, which must stay below MaxJobNumPerRun. Skip the
expansion with a clear reason when the resulting jobs would exceed that limit.

Also rename a test variable that tripped the misspell linter and clarify the
deferred-placeholder commit-status comment.

Co-Authored-By: Claude (Opus 4.8) <noreply@anthropic.com>
This commit is contained in:
silverwindandClaude committed 2026-05-29 10:09:10 +02:00
1 parent d35b3e65d6
commit 81d63c63b4
3 files changed
+15 -8

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ func CreateCommitStatusForRunJobs(ctx context.Context, run *actions_model.Action
for _, job := range jobs {
// A deferred-matrix placeholder's name changes when it expands, so a status created now
// would be orphaned; the expanded combos get theirs at expansion time.
// would be orphaned; the job emitter creates the combos' statuses after expansion.
if job.RawStrategy != "" && !job.IsMatrixEvaluated {
continue
}