entityConcurrencyKey builds a ${{ ... }} concurrency-group expression for entity-number based workflows. primaryParts are the event-number identifiers (e.g., "github.event.pull_request.number"), tailParts are the trailing fallbacks (e.g., "github.ref", "github.run_id"). When hasItemNumber is true, "
(primaryParts []string, tailParts []string, hasItemNumber bool)
| 175 | // inserted between the primary identifiers and the tail, providing a stable per-item |
| 176 | // key for manual workflow_dispatch runs triggered via the label trigger shorthand. |
| 177 | func entityConcurrencyKey(primaryParts []string, tailParts []string, hasItemNumber bool) string { |
| 178 | parts := make([]string, 0, safeAllocationCapacity(len(primaryParts), len(tailParts), 1)) |
| 179 | parts = append(parts, primaryParts...) |
| 180 | if hasItemNumber { |
| 181 | parts = append(parts, "inputs.item_number") |
| 182 | } |
| 183 | parts = append(parts, tailParts...) |
| 184 | return "${{ " + strings.Join(parts, " || ") + " }}" |
| 185 | } |
| 186 | |
| 187 | // botIsolatedConcurrencyKey builds a ${{ ... }} concurrency-group expression that |
| 188 | // routes GitHub App bot-triggered runs to a unique github.run_id key, preventing |
no test coverage detected