fix(workflow/release): parse string args 'action mode release-label'
This commit is contained in:
@@ -187,10 +187,26 @@ function devRole(letter) {
|
||||
|
||||
// ── Routing ───────────────────────────────────────────────────────────────────
|
||||
|
||||
const action = (args && args.action) || 'develop'
|
||||
const mode = (args && args.mode) || 'single'
|
||||
const release = args && args.release
|
||||
const context = args && args.context
|
||||
// Support both object args {action, mode, release} and space-separated string
|
||||
// "action mode release-label" (e.g. "develop multi enterprise-org-vault").
|
||||
let _args = args
|
||||
if (typeof args === 'string') {
|
||||
const parts = args.trim().split(/\s+/)
|
||||
// "develop multi enterprise-org-vault" → 3 parts
|
||||
// "develop enterprise-org-vault" → 2 parts (mode defaults to single)
|
||||
if (parts.length >= 3) {
|
||||
_args = { action: parts[0], mode: parts[1], release: parts.slice(2).join(' ') }
|
||||
} else if (parts.length === 2) {
|
||||
_args = { action: parts[0], mode: 'single', release: parts[1] }
|
||||
} else {
|
||||
_args = { action: parts[0] || 'develop' }
|
||||
}
|
||||
}
|
||||
|
||||
const action = (_args && _args.action) || 'develop'
|
||||
const mode = (_args && _args.mode) || 'single'
|
||||
const release = _args && _args.release
|
||||
const context = _args && _args.context
|
||||
|
||||
// ── ACTION: preflight ─────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user