MCPcopy Create free account
hub / github.com/github/gh-aw / entityConcurrencyKey

Function entityConcurrencyKey

pkg/workflow/concurrency.go:177–185  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
177func 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

Callers 1

Calls 1

safeAllocationCapacityFunction · 0.85

Tested by

no test coverage detected