@postman-cs/onboarding-api 3.5.7 → 3.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action.yml +232 -40
- package/package.json +1 -1
package/action.yml
CHANGED
|
@@ -404,33 +404,193 @@ runs:
|
|
|
404
404
|
name: Resolve immutable branch decision
|
|
405
405
|
shell: bash
|
|
406
406
|
env:
|
|
407
|
-
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
408
407
|
BRANCH_STRATEGY: ${{ inputs.branch-strategy }}
|
|
409
408
|
CANONICAL_BRANCH: ${{ inputs.canonical-branch }}
|
|
410
409
|
CHANNELS: ${{ inputs.channels }}
|
|
411
410
|
run: |
|
|
412
411
|
node <<'NODE'
|
|
413
412
|
const fs = require('node:fs');
|
|
414
|
-
const
|
|
413
|
+
const MAX_EVENT_PAYLOAD_BYTES = 1 * 1024 * 1024;
|
|
414
|
+
const clean = (value) => typeof value === 'string' ? value.trim() || undefined : undefined;
|
|
415
|
+
const normalizeRepoName = (value) => {
|
|
416
|
+
const name = clean(value)?.toLowerCase();
|
|
417
|
+
return name && /^[a-z0-9_.-]+\/[a-z0-9_.-]+$/.test(name) ? name : undefined;
|
|
418
|
+
};
|
|
419
|
+
const fieldState = (value, normalize) => {
|
|
420
|
+
if (value === undefined || value === null || value === '') return { state: 'absent' };
|
|
421
|
+
const normalized = normalize(value);
|
|
422
|
+
return normalized === undefined ? { state: 'malformed' } : { state: 'valid', value: normalized };
|
|
423
|
+
};
|
|
424
|
+
const repoIdentity = (value) => {
|
|
425
|
+
if (!value || typeof value !== 'object') return undefined;
|
|
426
|
+
const id = fieldState(value.id, (candidate) => {
|
|
427
|
+
if (typeof candidate === 'number' && Number.isSafeInteger(candidate) && candidate > 0) return String(candidate);
|
|
428
|
+
return typeof candidate === 'string' && /^[1-9][0-9]*$/.test(candidate) ? candidate : undefined;
|
|
429
|
+
});
|
|
430
|
+
const fullName = fieldState(value.full_name, normalizeRepoName);
|
|
431
|
+
return { id, fullName };
|
|
432
|
+
};
|
|
433
|
+
const sameRepo = (left, right) => {
|
|
434
|
+
if (!left || !right) return false;
|
|
435
|
+
if (left.id.state !== 'absent' || right.id.state !== 'absent') {
|
|
436
|
+
if (left.id.state !== 'valid' || right.id.state !== 'valid' || left.id.value !== right.id.value) return false;
|
|
437
|
+
if (left.fullName.state === 'malformed' || right.fullName.state === 'malformed') return false;
|
|
438
|
+
return left.fullName.state !== 'valid' || right.fullName.state !== 'valid' || left.fullName.value === right.fullName.value;
|
|
439
|
+
}
|
|
440
|
+
return left.fullName.state === 'valid' && right.fullName.state === 'valid' && left.fullName.value === right.fullName.value;
|
|
441
|
+
};
|
|
442
|
+
const directPrEvents = new Set([
|
|
443
|
+
'pull_request',
|
|
444
|
+
'pull_request_target',
|
|
445
|
+
'pull_request_review',
|
|
446
|
+
'pull_request_review_comment'
|
|
447
|
+
]);
|
|
448
|
+
const nestedPrEvents = new Set(['workflow_run', 'check_run', 'check_suite']);
|
|
449
|
+
const trustedNonPrEvents = new Set(['push', 'schedule', 'workflow_dispatch']);
|
|
450
|
+
|
|
415
451
|
const strategy = clean(process.env.BRANCH_STRATEGY) || 'legacy';
|
|
416
452
|
if (!['legacy', 'publish-gate', 'preview'].includes(strategy)) throw new Error('CONTRACT_BRANCH_STRATEGY_INVALID: expected legacy, publish-gate, or preview');
|
|
417
|
-
|
|
418
|
-
|
|
453
|
+
const eventName = clean(process.env.GITHUB_EVENT_NAME);
|
|
454
|
+
let event;
|
|
455
|
+
try {
|
|
456
|
+
const eventPath = clean(process.env.GITHUB_EVENT_PATH);
|
|
457
|
+
if (!eventPath) throw new Error('event path is missing');
|
|
458
|
+
const fd = fs.openSync(eventPath, 'r');
|
|
459
|
+
let payload;
|
|
460
|
+
try {
|
|
461
|
+
const stat = fs.fstatSync(fd);
|
|
462
|
+
if (!stat.isFile() || stat.size <= 0 || stat.size > MAX_EVENT_PAYLOAD_BYTES) throw new Error('event payload size is invalid');
|
|
463
|
+
payload = Buffer.alloc(stat.size);
|
|
464
|
+
let offset = 0;
|
|
465
|
+
while (offset < payload.length) {
|
|
466
|
+
const count = fs.readSync(fd, payload, offset, payload.length - offset, offset);
|
|
467
|
+
if (count === 0) throw new Error('event payload changed while reading');
|
|
468
|
+
offset += count;
|
|
469
|
+
}
|
|
470
|
+
if (fs.readSync(fd, Buffer.alloc(1), 0, 1, payload.length) !== 0) throw new Error('event payload exceeds size cap');
|
|
471
|
+
} finally {
|
|
472
|
+
fs.closeSync(fd);
|
|
473
|
+
}
|
|
474
|
+
event = JSON.parse(payload.toString('utf8'));
|
|
475
|
+
if (!event || typeof event !== 'object' || Array.isArray(event)) event = undefined;
|
|
476
|
+
} catch {}
|
|
419
477
|
const rawRef = clean(process.env.GITHUB_REF) || clean(process.env.GITHUB_REF_NAME);
|
|
420
|
-
const
|
|
421
|
-
const defaultBranch = clean(process.env.CANONICAL_BRANCH) || clean(event
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
478
|
+
const envHeadBranch = clean(process.env.GITHUB_HEAD_REF);
|
|
479
|
+
const defaultBranch = clean(process.env.CANONICAL_BRANCH) || clean(event?.repository?.default_branch);
|
|
480
|
+
const workflowRepo = repoIdentity({
|
|
481
|
+
id: process.env.GITHUB_REPOSITORY_ID,
|
|
482
|
+
full_name: process.env.GITHUB_REPOSITORY
|
|
483
|
+
});
|
|
484
|
+
const eventRepo = repoIdentity(event?.repository);
|
|
485
|
+
const hasPrMarker = Boolean(
|
|
486
|
+
event && (
|
|
487
|
+
Object.prototype.hasOwnProperty.call(event, 'pull_request') ||
|
|
488
|
+
event.issue?.pull_request ||
|
|
489
|
+
event.merge_group
|
|
490
|
+
)
|
|
491
|
+
);
|
|
492
|
+
let isPrContext = Boolean(
|
|
493
|
+
envHeadBranch || hasPrMarker || directPrEvents.has(eventName) || nestedPrEvents.has(eventName)
|
|
494
|
+
);
|
|
495
|
+
let isForkPr = false;
|
|
496
|
+
let sameRepository = false;
|
|
497
|
+
let eventEligible = false;
|
|
498
|
+
let eventReason;
|
|
499
|
+
let headBranch;
|
|
500
|
+
|
|
501
|
+
if (!eventName) {
|
|
502
|
+
eventReason = 'event name is missing';
|
|
503
|
+
} else if (!event) {
|
|
504
|
+
eventReason = `event ${eventName} payload is missing or unreadable`;
|
|
505
|
+
} else if (!workflowRepo) {
|
|
506
|
+
eventReason = 'workflow repository identity is missing or malformed';
|
|
507
|
+
} else if (!eventRepo || !sameRepo(eventRepo, workflowRepo)) {
|
|
508
|
+
eventReason = `event ${eventName} repository does not match the workflow repository`;
|
|
509
|
+
} else if (trustedNonPrEvents.has(eventName)) {
|
|
510
|
+
if (isPrContext) {
|
|
511
|
+
eventReason = `event ${eventName} unexpectedly carries pull-request metadata`;
|
|
512
|
+
} else {
|
|
513
|
+
eventEligible = true;
|
|
514
|
+
sameRepository = true;
|
|
515
|
+
headBranch = rawRef?.startsWith('refs/heads/') ? rawRef.slice(11) : undefined;
|
|
516
|
+
eventReason = `trusted non-PR event ${eventName}`;
|
|
517
|
+
}
|
|
518
|
+
} else if (directPrEvents.has(eventName)) {
|
|
519
|
+
isPrContext = true;
|
|
520
|
+
const pullRequest = event.pull_request;
|
|
521
|
+
const headRepo = repoIdentity(pullRequest?.head?.repo);
|
|
522
|
+
const baseRepo = repoIdentity(pullRequest?.base?.repo);
|
|
523
|
+
const payloadHeadBranch = clean(pullRequest?.head?.ref);
|
|
524
|
+
if (!eventRepo || !headRepo || !baseRepo || !payloadHeadBranch) {
|
|
525
|
+
eventReason = `${eventName} repository or head-branch identity is missing or malformed`;
|
|
526
|
+
} else if (!sameRepo(baseRepo, eventRepo)) {
|
|
527
|
+
eventReason = `${eventName} base repository does not match the workflow repository`;
|
|
528
|
+
} else if (!sameRepo(headRepo, eventRepo)) {
|
|
529
|
+
isForkPr = true;
|
|
530
|
+
eventReason = `${eventName} head repository is not the workflow repository`;
|
|
531
|
+
} else if (envHeadBranch && envHeadBranch !== payloadHeadBranch) {
|
|
532
|
+
eventReason = `${eventName} head branch does not match GITHUB_HEAD_REF`;
|
|
533
|
+
} else {
|
|
534
|
+
eventEligible = true;
|
|
535
|
+
sameRepository = true;
|
|
536
|
+
headBranch = payloadHeadBranch;
|
|
537
|
+
eventReason = `same-repository ${eventName}`;
|
|
538
|
+
}
|
|
539
|
+
} else if (nestedPrEvents.has(eventName)) {
|
|
540
|
+
isPrContext = true;
|
|
541
|
+
const container = eventName === 'workflow_run' ? event.workflow_run : event[eventName];
|
|
542
|
+
const pullRequests = Array.isArray(container?.pull_requests) ? container.pull_requests : [];
|
|
543
|
+
if (!eventRepo || pullRequests.length !== 1) {
|
|
544
|
+
eventReason = `${eventName} requires exactly one pull request with repository identity`;
|
|
545
|
+
} else {
|
|
546
|
+
const pullRequest = pullRequests[0];
|
|
547
|
+
const headRepo = repoIdentity(pullRequest?.head?.repo);
|
|
548
|
+
const baseRepo = repoIdentity(pullRequest?.base?.repo);
|
|
549
|
+
const payloadHeadBranch = clean(pullRequest?.head?.ref);
|
|
550
|
+
if (!headRepo || !baseRepo || !payloadHeadBranch) {
|
|
551
|
+
eventReason = `${eventName} pull-request repository or head-branch identity is missing or malformed`;
|
|
552
|
+
} else if (!sameRepo(baseRepo, eventRepo)) {
|
|
553
|
+
eventReason = `${eventName} base repository does not match the workflow repository`;
|
|
554
|
+
} else if (!sameRepo(headRepo, eventRepo)) {
|
|
555
|
+
isForkPr = true;
|
|
556
|
+
eventReason = `${eventName} head repository is not the workflow repository`;
|
|
557
|
+
} else if (envHeadBranch && envHeadBranch !== payloadHeadBranch) {
|
|
558
|
+
eventReason = `${eventName} head branch does not match GITHUB_HEAD_REF`;
|
|
559
|
+
} else {
|
|
560
|
+
eventEligible = true;
|
|
561
|
+
sameRepository = true;
|
|
562
|
+
headBranch = payloadHeadBranch;
|
|
563
|
+
eventReason = `same-repository ${eventName}`;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
} else {
|
|
567
|
+
eventReason = `event ${eventName} is not credential-eligible`;
|
|
568
|
+
}
|
|
569
|
+
if (isPrContext && !eventEligible) isForkPr = true;
|
|
570
|
+
|
|
426
571
|
let refKind = rawRef?.startsWith('refs/tags/') ? 'tag' : headBranch ? 'branch' : 'unknown';
|
|
427
572
|
if (headBranch && defaultBranch && headBranch === defaultBranch) refKind = 'default-branch';
|
|
428
|
-
const identity = {
|
|
573
|
+
const identity = {
|
|
574
|
+
provider: 'github',
|
|
575
|
+
eventName,
|
|
576
|
+
headBranch,
|
|
577
|
+
rawRef,
|
|
578
|
+
defaultBranch,
|
|
579
|
+
refKind,
|
|
580
|
+
isPrContext,
|
|
581
|
+
isForkPr,
|
|
582
|
+
sameRepository,
|
|
583
|
+
eventEligible,
|
|
584
|
+
headSha: clean(process.env.GITHUB_SHA)
|
|
585
|
+
};
|
|
429
586
|
const canonicalBranch = clean(process.env.CANONICAL_BRANCH) || defaultBranch;
|
|
430
|
-
let tier = '
|
|
431
|
-
let reason =
|
|
587
|
+
let tier = 'gated';
|
|
588
|
+
let reason = `${eventReason}: credentials and mutations are ineligible`;
|
|
432
589
|
let channel;
|
|
433
|
-
if (strategy
|
|
590
|
+
if (eventEligible && strategy === 'legacy') {
|
|
591
|
+
tier = 'legacy';
|
|
592
|
+
reason = `${eventReason}; branch-strategy legacy: branch-blind pre-v2 behavior`;
|
|
593
|
+
} else if (eventEligible) {
|
|
434
594
|
if (!canonicalBranch) throw new Error('CONTRACT_DEFAULT_BRANCH_UNRESOLVED: set the canonical-branch input');
|
|
435
595
|
const rules = (clean(process.env.CHANNELS)?.split(',') || []).filter(Boolean).map((entry) => {
|
|
436
596
|
const parts = entry.split('=').map((part) => part.trim());
|
|
@@ -442,38 +602,69 @@ runs:
|
|
|
442
602
|
if (refKind === 'tag' || refKind === 'unknown' || !headBranch) { tier = 'gated'; reason = `ref kind ${refKind}: no-op`; }
|
|
443
603
|
else if (headBranch === canonicalBranch) { tier = 'canonical'; reason = `head branch equals canonical branch ${canonicalBranch}`; }
|
|
444
604
|
else if (channel) { tier = 'channel'; reason = `branch ${headBranch} matches channel ${channel.pattern}=${channel.code}`; }
|
|
445
|
-
else if (strategy === 'preview'
|
|
446
|
-
else { tier = 'gated'; reason =
|
|
605
|
+
else if (strategy === 'preview') { tier = 'preview'; reason = `branch ${headBranch} under branch-strategy preview`; }
|
|
606
|
+
else { tier = 'gated'; reason = `branch ${headBranch} under branch-strategy publish-gate`; }
|
|
447
607
|
}
|
|
448
608
|
const decision = { tier, strategy, identity, canonicalBranch, ...(channel && tier === 'channel' ? { channel } : {}), reason };
|
|
449
609
|
const serialized = JSON.stringify(decision);
|
|
450
610
|
fs.appendFileSync(process.env.GITHUB_OUTPUT, `tier=${tier}\nbranch-decision=${serialized}\n`);
|
|
451
611
|
fs.appendFileSync(process.env.GITHUB_ENV, `POSTMAN_BRANCH_DECISION=${serialized}\n`);
|
|
452
612
|
NODE
|
|
613
|
+
- id: mask_postman_credentials
|
|
614
|
+
name: Mask Postman credentials
|
|
615
|
+
if: ${{ steps.branch_decision.outputs.tier != 'gated' }}
|
|
616
|
+
shell: bash
|
|
617
|
+
env:
|
|
618
|
+
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
619
|
+
POSTMAN_API_KEY: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
|
|
620
|
+
POSTMAN_ACCESS_TOKEN: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-access-token || '' }}
|
|
621
|
+
INSIGHTS_POSTMAN_API_KEY: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.insights-postman-api-key || '' }}
|
|
622
|
+
INSIGHTS_POSTMAN_ACCESS_TOKEN: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.insights-postman-access-token || '' }}
|
|
623
|
+
run: |
|
|
624
|
+
mask_secret() {
|
|
625
|
+
local value="$1"
|
|
626
|
+
[ -n "$value" ] || return 0
|
|
627
|
+
value=${value//'%'/%25}
|
|
628
|
+
value=${value//$'\r'/%0D}
|
|
629
|
+
value=${value//$'\n'/%0A}
|
|
630
|
+
printf '::add-mask::%s\n' "$value"
|
|
631
|
+
}
|
|
632
|
+
mask_secret "$POSTMAN_API_KEY"
|
|
633
|
+
mask_secret "$POSTMAN_ACCESS_TOKEN"
|
|
634
|
+
mask_secret "$INSIGHTS_POSTMAN_API_KEY"
|
|
635
|
+
mask_secret "$INSIGHTS_POSTMAN_ACCESS_TOKEN"
|
|
453
636
|
- id: validate_postman_stack
|
|
454
637
|
name: Validate Postman stack and region
|
|
638
|
+
if: ${{ steps.branch_decision.outputs.tier != 'gated' }}
|
|
455
639
|
shell: bash
|
|
456
640
|
env:
|
|
457
641
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
458
642
|
POSTMAN_REGION: ${{ inputs.postman-region }}
|
|
459
643
|
POSTMAN_STACK: ${{ inputs.postman-stack }}
|
|
460
644
|
WORKING_DIRECTORY: ${{ inputs.working-directory }}
|
|
645
|
+
SPEC_PATH: ${{ inputs.spec-path }}
|
|
461
646
|
CREDENTIAL_PREFLIGHT: ${{ inputs.credential-preflight }}
|
|
462
647
|
REPO_WRITE_MODE: ${{ inputs.repo-write-mode }}
|
|
463
|
-
POSTMAN_API_KEY: ${{ inputs.postman-api-key }}
|
|
464
|
-
POSTMAN_ACCESS_TOKEN: ${{ inputs.postman-access-token }}
|
|
648
|
+
POSTMAN_API_KEY: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
|
|
649
|
+
POSTMAN_ACCESS_TOKEN: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-access-token || '' }}
|
|
465
650
|
ENABLE_INSIGHTS: ${{ inputs.enable-insights }}
|
|
466
651
|
ONBOARDING_SCOPE: ${{ inputs.onboarding-scope }}
|
|
467
652
|
BRANCH_TIER: ${{ steps.branch_decision.outputs.tier }}
|
|
468
|
-
INSIGHTS_POSTMAN_API_KEY: ${{ inputs.insights-postman-api-key }}
|
|
469
|
-
INSIGHTS_POSTMAN_ACCESS_TOKEN: ${{ inputs.insights-postman-access-token }}
|
|
653
|
+
INSIGHTS_POSTMAN_API_KEY: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.insights-postman-api-key || '' }}
|
|
654
|
+
INSIGHTS_POSTMAN_ACCESS_TOKEN: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.insights-postman-access-token || '' }}
|
|
470
655
|
run: |
|
|
471
656
|
if [ -n "$WORKING_DIRECTORY" ]; then
|
|
472
|
-
if ! node -e 'const fs=require("node:fs"),path=require("node:path");const
|
|
657
|
+
if ! node -e 'const fs=require("node:fs"),path=require("node:path");const workspace=fs.realpathSync(process.env.GITHUB_WORKSPACE);const target=path.resolve(workspace,process.env.WORKING_DIRECTORY);if(!fs.existsSync(target)||!fs.statSync(target).isDirectory())process.exit(1);const realTarget=fs.realpathSync(target);const relative=path.relative(workspace,realTarget);process.exit(relative===""||(!relative.startsWith(`..${path.sep}`)&&relative!==".."&&!path.isAbsolute(relative))?0:1)'; then
|
|
473
658
|
echo "::error::working-directory does not exist under GITHUB_WORKSPACE. Create the directory or correct the input."
|
|
474
659
|
exit 1
|
|
475
660
|
fi
|
|
476
661
|
fi
|
|
662
|
+
if [ -n "$SPEC_PATH" ]; then
|
|
663
|
+
if ! node -e 'const fs=require("node:fs"),path=require("node:path");const workspace=fs.realpathSync(process.env.GITHUB_WORKSPACE);const root=path.resolve(workspace,process.env.WORKING_DIRECTORY||"");const target=path.resolve(root,process.env.SPEC_PATH);if(!fs.existsSync(target)||!fs.statSync(target).isFile())process.exit(1);const realTarget=fs.realpathSync(target);const relative=path.relative(workspace,realTarget);process.exit(!relative.startsWith(`..${path.sep}`)&&relative!==".."&&!path.isAbsolute(relative)?0:1)'; then
|
|
664
|
+
echo "::error::spec-path does not name a file under GITHUB_WORKSPACE. Check out the file and use a repository-relative path."
|
|
665
|
+
exit 1
|
|
666
|
+
fi
|
|
667
|
+
fi
|
|
477
668
|
case "$POSTMAN_STACK" in
|
|
478
669
|
prod|beta) ;;
|
|
479
670
|
*)
|
|
@@ -523,7 +714,8 @@ runs:
|
|
|
523
714
|
fi
|
|
524
715
|
- id: bootstrap
|
|
525
716
|
name: Bootstrap Postman Assets
|
|
526
|
-
|
|
717
|
+
if: ${{ steps.branch_decision.outputs.tier != 'gated' }}
|
|
718
|
+
uses: postman-cs/postman-bootstrap-action@v2.21.10
|
|
527
719
|
env:
|
|
528
720
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
529
721
|
POSTMAN_BRANCH_DECISION: ${{ steps.branch_decision.outputs.branch-decision }}
|
|
@@ -568,8 +760,8 @@ runs:
|
|
|
568
760
|
breaking-summary-path: ${{ inputs.breaking-summary-path }}
|
|
569
761
|
breaking-log-path: ${{ inputs.breaking-log-path }}
|
|
570
762
|
governance-mapping-json: ${{ inputs.governance-mapping-json }}
|
|
571
|
-
github-token: ${{ inputs.github-token }}
|
|
572
|
-
gh-fallback-token: ${{ inputs.gh-fallback-token }}
|
|
763
|
+
github-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.github-token || '' }}
|
|
764
|
+
gh-fallback-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.gh-fallback-token || '' }}
|
|
573
765
|
postman-api-key: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
|
|
574
766
|
postman-access-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-access-token || '' }}
|
|
575
767
|
credential-preflight: ${{ inputs.credential-preflight }}
|
|
@@ -582,7 +774,7 @@ runs:
|
|
|
582
774
|
- id: smoke_flow
|
|
583
775
|
name: Apply Smoke flow
|
|
584
776
|
if: ${{ inputs.onboarding-scope == 'full' && (inputs.flow-path != '' || inputs.flow-mode != '') && steps.branch_decision.outputs.tier != 'gated' }}
|
|
585
|
-
uses: postman-cs/postman-smoke-flow-action@v3.7.
|
|
777
|
+
uses: postman-cs/postman-smoke-flow-action@v3.7.4
|
|
586
778
|
env:
|
|
587
779
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
588
780
|
POSTMAN_BRANCH_DECISION: ${{ steps.branch_decision.outputs.branch-decision }}
|
|
@@ -597,8 +789,8 @@ runs:
|
|
|
597
789
|
flow-allow-delete: ${{ inputs.flow-allow-delete }}
|
|
598
790
|
persist-derived-flow: ${{ inputs.persist-derived-flow }}
|
|
599
791
|
spec-path: ${{ inputs.spec-path }}
|
|
600
|
-
postman-api-key: ${{ inputs.postman-api-key }}
|
|
601
|
-
postman-access-token: ${{ inputs.postman-access-token }}
|
|
792
|
+
postman-api-key: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
|
|
793
|
+
postman-access-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-access-token || '' }}
|
|
602
794
|
postman-region: ${{ inputs.postman-region }}
|
|
603
795
|
team-id: ${{ inputs.postman-team-id }}
|
|
604
796
|
branch-strategy: ${{ inputs.branch-strategy }}
|
|
@@ -607,7 +799,7 @@ runs:
|
|
|
607
799
|
- id: repo_sync
|
|
608
800
|
name: Sync Repository and Workspace
|
|
609
801
|
if: ${{ steps.branch_decision.outputs.tier != 'gated' }}
|
|
610
|
-
uses: postman-cs/postman-repo-sync-action@v2.10.
|
|
802
|
+
uses: postman-cs/postman-repo-sync-action@v2.10.9
|
|
611
803
|
env:
|
|
612
804
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
613
805
|
POSTMAN_BRANCH_DECISION: ${{ steps.branch_decision.outputs.branch-decision }}
|
|
@@ -638,15 +830,15 @@ runs:
|
|
|
638
830
|
current-ref: ${{ inputs.current-ref }}
|
|
639
831
|
committer-name: ${{ inputs.committer-name }}
|
|
640
832
|
committer-email: ${{ inputs.committer-email }}
|
|
641
|
-
postman-api-key: ${{ inputs.postman-api-key }}
|
|
642
|
-
postman-access-token: ${{ inputs.postman-access-token }}
|
|
833
|
+
postman-api-key: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
|
|
834
|
+
postman-access-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-access-token || '' }}
|
|
643
835
|
credential-preflight: ${{ inputs.credential-preflight }}
|
|
644
836
|
branch-strategy: ${{ inputs.branch-strategy }}
|
|
645
837
|
canonical-branch: ${{ inputs.canonical-branch }}
|
|
646
838
|
channels: ${{ inputs.channels }}
|
|
647
839
|
preview-ttl: ${{ inputs.preview-ttl }}
|
|
648
|
-
github-token: ${{ inputs.github-token }}
|
|
649
|
-
gh-fallback-token: ${{ inputs.gh-fallback-token }}
|
|
840
|
+
github-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.github-token || '' }}
|
|
841
|
+
gh-fallback-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.gh-fallback-token || '' }}
|
|
650
842
|
org-mode: ${{ inputs.org-mode }}
|
|
651
843
|
integration-backend: ${{ inputs.integration-backend }}
|
|
652
844
|
postman-region: ${{ inputs.postman-region }}
|
|
@@ -669,7 +861,7 @@ runs:
|
|
|
669
861
|
# `postman login --with-api-key`, which has no access-token login path. When
|
|
670
862
|
# postman-api-key is absent (access-token-primary runs), skip the tests with
|
|
671
863
|
# a warning instead of failing the run.
|
|
672
|
-
if: ${{ inputs.onboarding-scope == 'full' && steps.bootstrap.outputs.collections-json != '' && inputs.skip-built-in-tests != 'true' && inputs.postman-api-key == '' }}
|
|
864
|
+
if: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.onboarding-scope == 'full' && steps.bootstrap.outputs.collections-json != '' && inputs.skip-built-in-tests != 'true' && inputs.postman-api-key == '' }}
|
|
673
865
|
shell: bash
|
|
674
866
|
env:
|
|
675
867
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
@@ -677,7 +869,7 @@ runs:
|
|
|
677
869
|
echo "::warning::Skipping built-in smoke and contract tests: no postman-api-key was provided. The Postman CLI (postman login --with-api-key, then postman collection run) has no access-token login, so these tests require a PMAK. Provide postman-api-key to enable them, or set skip-built-in-tests: true to silence this warning."
|
|
678
870
|
- id: install_postman_cli_windows
|
|
679
871
|
name: Install Postman CLI on Windows
|
|
680
|
-
if: ${{ inputs.onboarding-scope == 'full' && runner.os == 'Windows' && steps.bootstrap.outputs.collections-json != '' && inputs.skip-built-in-tests != 'true' && inputs.postman-api-key != '' }}
|
|
872
|
+
if: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.onboarding-scope == 'full' && runner.os == 'Windows' && steps.bootstrap.outputs.collections-json != '' && inputs.skip-built-in-tests != 'true' && inputs.postman-api-key != '' }}
|
|
681
873
|
shell: pwsh
|
|
682
874
|
env:
|
|
683
875
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
@@ -693,12 +885,12 @@ runs:
|
|
|
693
885
|
}
|
|
694
886
|
- id: run_tests_junit
|
|
695
887
|
name: Run smoke and contract collections with JUnit output
|
|
696
|
-
if: ${{ inputs.onboarding-scope == 'full' && steps.bootstrap.outputs.collections-json != '' && inputs.skip-built-in-tests != 'true' && inputs.postman-api-key != '' }}
|
|
888
|
+
if: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.onboarding-scope == 'full' && steps.bootstrap.outputs.collections-json != '' && inputs.skip-built-in-tests != 'true' && inputs.postman-api-key != '' }}
|
|
697
889
|
shell: bash
|
|
698
890
|
continue-on-error: true
|
|
699
891
|
env:
|
|
700
892
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
701
|
-
POSTMAN_API_KEY: ${{ inputs.postman-api-key }}
|
|
893
|
+
POSTMAN_API_KEY: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
|
|
702
894
|
POSTMAN_REGION: ${{ inputs.postman-region }}
|
|
703
895
|
PROJECT_NAME: ${{ inputs.project-name }}
|
|
704
896
|
COLLECTIONS_JSON: ${{ steps.bootstrap.outputs.collections-json }}
|
|
@@ -794,7 +986,7 @@ runs:
|
|
|
794
986
|
fi
|
|
795
987
|
- id: upload_junit_artifact
|
|
796
988
|
name: Upload Postman JUnit results
|
|
797
|
-
if: always() && inputs.onboarding-scope == 'full' && inputs.skip-built-in-tests != 'true'
|
|
989
|
+
if: always() && steps.branch_decision.outputs.tier != 'gated' && inputs.onboarding-scope == 'full' && inputs.skip-built-in-tests != 'true'
|
|
798
990
|
env:
|
|
799
991
|
POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
|
|
800
992
|
uses: actions/upload-artifact@v7.0.1
|
|
@@ -815,13 +1007,13 @@ runs:
|
|
|
815
1007
|
environment-id: ${{ fromJSON(steps.repo_sync.outputs.environment-uids-json)[fromJSON(inputs.environments-json)[0]] }}
|
|
816
1008
|
system-environment-id: ${{ fromJSON(inputs.system-env-map-json)[fromJSON(inputs.environments-json)[0]] }}
|
|
817
1009
|
cluster-name: ${{ inputs.cluster-name }}
|
|
818
|
-
postman-api-key: ${{ inputs.insights-postman-api-key }}
|
|
819
|
-
postman-access-token: ${{ inputs.insights-postman-access-token }}
|
|
1010
|
+
postman-api-key: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.insights-postman-api-key || '' }}
|
|
1011
|
+
postman-access-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.insights-postman-access-token || '' }}
|
|
820
1012
|
credential-preflight: ${{ inputs.credential-preflight }}
|
|
821
1013
|
branch-strategy: ${{ inputs.branch-strategy }}
|
|
822
1014
|
canonical-branch: ${{ inputs.canonical-branch }}
|
|
823
1015
|
channels: ${{ inputs.channels }}
|
|
824
1016
|
postman-team-id: ${{ inputs.postman-team-id }}
|
|
825
|
-
github-token: ${{ inputs.github-token }}
|
|
1017
|
+
github-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.github-token || '' }}
|
|
826
1018
|
postman-region: ${{ inputs.postman-region }}
|
|
827
1019
|
postman-stack: ${{ inputs.postman-stack }}
|