@postman-cs/onboarding-api 3.5.8 → 3.5.10

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.
Files changed (2) hide show
  1. package/action.yml +222 -60
  2. package/package.json +1 -1
package/action.yml CHANGED
@@ -400,59 +400,197 @@ outputs:
400
400
  runs:
401
401
  using: composite
402
402
  steps:
403
- - id: mask_postman_credentials
404
- name: Mask Postman credentials
405
- shell: bash
406
- env:
407
- POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
408
- POSTMAN_API_KEY: ${{ inputs.postman-api-key }}
409
- POSTMAN_ACCESS_TOKEN: ${{ inputs.postman-access-token }}
410
- INSIGHTS_POSTMAN_API_KEY: ${{ inputs.insights-postman-api-key }}
411
- INSIGHTS_POSTMAN_ACCESS_TOKEN: ${{ inputs.insights-postman-access-token }}
412
- run: |
413
- mask_secret() {
414
- local value="$1"
415
- [ -n "$value" ] || return 0
416
- value=${value//'%'/%25}
417
- value=${value//$'\r'/%0D}
418
- value=${value//$'\n'/%0A}
419
- printf '::add-mask::%s\n' "$value"
420
- }
421
- mask_secret "$POSTMAN_API_KEY"
422
- mask_secret "$POSTMAN_ACCESS_TOKEN"
423
- mask_secret "$INSIGHTS_POSTMAN_API_KEY"
424
- mask_secret "$INSIGHTS_POSTMAN_ACCESS_TOKEN"
425
403
  - id: branch_decision
426
404
  name: Resolve immutable branch decision
427
405
  shell: bash
428
406
  env:
429
- POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
430
407
  BRANCH_STRATEGY: ${{ inputs.branch-strategy }}
431
408
  CANONICAL_BRANCH: ${{ inputs.canonical-branch }}
432
409
  CHANNELS: ${{ inputs.channels }}
433
410
  run: |
434
411
  node <<'NODE'
435
412
  const fs = require('node:fs');
436
- const clean = (value) => (value || '').trim() || undefined;
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
+
437
451
  const strategy = clean(process.env.BRANCH_STRATEGY) || 'legacy';
438
452
  if (!['legacy', 'publish-gate', 'preview'].includes(strategy)) throw new Error('CONTRACT_BRANCH_STRATEGY_INVALID: expected legacy, publish-gate, or preview');
439
- let event = {};
440
- try { event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')); } catch {}
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 {}
441
477
  const rawRef = clean(process.env.GITHUB_REF) || clean(process.env.GITHUB_REF_NAME);
442
- const headBranch = clean(process.env.GITHUB_HEAD_REF) || (rawRef?.startsWith('refs/heads/') ? rawRef.slice(11) : undefined);
443
- const defaultBranch = clean(process.env.CANONICAL_BRANCH) || clean(event.repository?.default_branch);
444
- const isPrContext = Boolean(clean(process.env.GITHUB_HEAD_REF));
445
- const headRepo = event.pull_request?.head?.repo?.full_name;
446
- const baseRepo = event.pull_request?.base?.repo?.full_name || event.repository?.full_name;
447
- const isForkPr = Boolean(headRepo && baseRepo && headRepo !== baseRepo);
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
+
448
571
  let refKind = rawRef?.startsWith('refs/tags/') ? 'tag' : headBranch ? 'branch' : 'unknown';
449
572
  if (headBranch && defaultBranch && headBranch === defaultBranch) refKind = 'default-branch';
450
- const identity = { provider: 'github', headBranch, rawRef, defaultBranch, refKind, isPrContext, isForkPr, headSha: clean(process.env.GITHUB_SHA) };
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
+ };
451
586
  const canonicalBranch = clean(process.env.CANONICAL_BRANCH) || defaultBranch;
452
- let tier = 'legacy';
453
- let reason = 'branch-strategy legacy: branch-blind pre-v2 behavior';
587
+ let tier = 'gated';
588
+ let reason = `${eventReason}: credentials and mutations are ineligible`;
454
589
  let channel;
455
- if (strategy !== 'legacy') {
590
+ if (eventEligible && strategy === 'legacy') {
591
+ tier = 'legacy';
592
+ reason = `${eventReason}; branch-strategy legacy: branch-blind pre-v2 behavior`;
593
+ } else if (eventEligible) {
456
594
  if (!canonicalBranch) throw new Error('CONTRACT_DEFAULT_BRANCH_UNRESOLVED: set the canonical-branch input');
457
595
  const rules = (clean(process.env.CHANNELS)?.split(',') || []).filter(Boolean).map((entry) => {
458
596
  const parts = entry.split('=').map((part) => part.trim());
@@ -462,7 +600,6 @@ runs:
462
600
  if (!rules.some((rule) => rule.pattern === 'release/*')) rules.push({ pattern: 'release/*', code: 'RC' });
463
601
  channel = rules.find((rule) => rule.pattern.endsWith('*') ? headBranch?.startsWith(rule.pattern.slice(0, -1)) : headBranch === rule.pattern);
464
602
  if (refKind === 'tag' || refKind === 'unknown' || !headBranch) { tier = 'gated'; reason = `ref kind ${refKind}: no-op`; }
465
- else if (isForkPr) { tier = 'gated'; reason = 'fork PR: credentialed tiers are ineligible'; }
466
603
  else if (headBranch === canonicalBranch) { tier = 'canonical'; reason = `head branch equals canonical branch ${canonicalBranch}`; }
467
604
  else if (channel) { tier = 'channel'; reason = `branch ${headBranch} matches channel ${channel.pattern}=${channel.code}`; }
468
605
  else if (strategy === 'preview') { tier = 'preview'; reason = `branch ${headBranch} under branch-strategy preview`; }
@@ -473,8 +610,32 @@ runs:
473
610
  fs.appendFileSync(process.env.GITHUB_OUTPUT, `tier=${tier}\nbranch-decision=${serialized}\n`);
474
611
  fs.appendFileSync(process.env.GITHUB_ENV, `POSTMAN_BRANCH_DECISION=${serialized}\n`);
475
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"
476
636
  - id: validate_postman_stack
477
637
  name: Validate Postman stack and region
638
+ if: ${{ steps.branch_decision.outputs.tier != 'gated' }}
478
639
  shell: bash
479
640
  env:
480
641
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
@@ -484,13 +645,13 @@ runs:
484
645
  SPEC_PATH: ${{ inputs.spec-path }}
485
646
  CREDENTIAL_PREFLIGHT: ${{ inputs.credential-preflight }}
486
647
  REPO_WRITE_MODE: ${{ inputs.repo-write-mode }}
487
- POSTMAN_API_KEY: ${{ inputs.postman-api-key }}
488
- 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 || '' }}
489
650
  ENABLE_INSIGHTS: ${{ inputs.enable-insights }}
490
651
  ONBOARDING_SCOPE: ${{ inputs.onboarding-scope }}
491
652
  BRANCH_TIER: ${{ steps.branch_decision.outputs.tier }}
492
- INSIGHTS_POSTMAN_API_KEY: ${{ inputs.insights-postman-api-key }}
493
- 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 || '' }}
494
655
  run: |
495
656
  if [ -n "$WORKING_DIRECTORY" ]; then
496
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
@@ -553,7 +714,8 @@ runs:
553
714
  fi
554
715
  - id: bootstrap
555
716
  name: Bootstrap Postman Assets
556
- uses: postman-cs/postman-bootstrap-action@v2.21.5
717
+ if: ${{ steps.branch_decision.outputs.tier != 'gated' }}
718
+ uses: postman-cs/postman-bootstrap-action@v2.21.10
557
719
  env:
558
720
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
559
721
  POSTMAN_BRANCH_DECISION: ${{ steps.branch_decision.outputs.branch-decision }}
@@ -598,8 +760,8 @@ runs:
598
760
  breaking-summary-path: ${{ inputs.breaking-summary-path }}
599
761
  breaking-log-path: ${{ inputs.breaking-log-path }}
600
762
  governance-mapping-json: ${{ inputs.governance-mapping-json }}
601
- github-token: ${{ inputs.github-token }}
602
- 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 || '' }}
603
765
  postman-api-key: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
604
766
  postman-access-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-access-token || '' }}
605
767
  credential-preflight: ${{ inputs.credential-preflight }}
@@ -612,7 +774,7 @@ runs:
612
774
  - id: smoke_flow
613
775
  name: Apply Smoke flow
614
776
  if: ${{ inputs.onboarding-scope == 'full' && (inputs.flow-path != '' || inputs.flow-mode != '') && steps.branch_decision.outputs.tier != 'gated' }}
615
- uses: postman-cs/postman-smoke-flow-action@v3.7.3
777
+ uses: postman-cs/postman-smoke-flow-action@v3.7.4
616
778
  env:
617
779
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
618
780
  POSTMAN_BRANCH_DECISION: ${{ steps.branch_decision.outputs.branch-decision }}
@@ -627,8 +789,8 @@ runs:
627
789
  flow-allow-delete: ${{ inputs.flow-allow-delete }}
628
790
  persist-derived-flow: ${{ inputs.persist-derived-flow }}
629
791
  spec-path: ${{ inputs.spec-path }}
630
- postman-api-key: ${{ inputs.postman-api-key }}
631
- 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 || '' }}
632
794
  postman-region: ${{ inputs.postman-region }}
633
795
  team-id: ${{ inputs.postman-team-id }}
634
796
  branch-strategy: ${{ inputs.branch-strategy }}
@@ -637,7 +799,7 @@ runs:
637
799
  - id: repo_sync
638
800
  name: Sync Repository and Workspace
639
801
  if: ${{ steps.branch_decision.outputs.tier != 'gated' }}
640
- uses: postman-cs/postman-repo-sync-action@v2.10.3
802
+ uses: postman-cs/postman-repo-sync-action@v2.10.9
641
803
  env:
642
804
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
643
805
  POSTMAN_BRANCH_DECISION: ${{ steps.branch_decision.outputs.branch-decision }}
@@ -668,15 +830,15 @@ runs:
668
830
  current-ref: ${{ inputs.current-ref }}
669
831
  committer-name: ${{ inputs.committer-name }}
670
832
  committer-email: ${{ inputs.committer-email }}
671
- postman-api-key: ${{ inputs.postman-api-key }}
672
- 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 || '' }}
673
835
  credential-preflight: ${{ inputs.credential-preflight }}
674
836
  branch-strategy: ${{ inputs.branch-strategy }}
675
837
  canonical-branch: ${{ inputs.canonical-branch }}
676
838
  channels: ${{ inputs.channels }}
677
839
  preview-ttl: ${{ inputs.preview-ttl }}
678
- github-token: ${{ inputs.github-token }}
679
- 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 || '' }}
680
842
  org-mode: ${{ inputs.org-mode }}
681
843
  integration-backend: ${{ inputs.integration-backend }}
682
844
  postman-region: ${{ inputs.postman-region }}
@@ -699,7 +861,7 @@ runs:
699
861
  # `postman login --with-api-key`, which has no access-token login path. When
700
862
  # postman-api-key is absent (access-token-primary runs), skip the tests with
701
863
  # a warning instead of failing the run.
702
- 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 == '' }}
703
865
  shell: bash
704
866
  env:
705
867
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
@@ -707,7 +869,7 @@ runs:
707
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."
708
870
  - id: install_postman_cli_windows
709
871
  name: Install Postman CLI on Windows
710
- 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 != '' }}
711
873
  shell: pwsh
712
874
  env:
713
875
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
@@ -723,12 +885,12 @@ runs:
723
885
  }
724
886
  - id: run_tests_junit
725
887
  name: Run smoke and contract collections with JUnit output
726
- 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 != '' }}
727
889
  shell: bash
728
890
  continue-on-error: true
729
891
  env:
730
892
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
731
- POSTMAN_API_KEY: ${{ inputs.postman-api-key }}
893
+ POSTMAN_API_KEY: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.postman-api-key || '' }}
732
894
  POSTMAN_REGION: ${{ inputs.postman-region }}
733
895
  PROJECT_NAME: ${{ inputs.project-name }}
734
896
  COLLECTIONS_JSON: ${{ steps.bootstrap.outputs.collections-json }}
@@ -824,7 +986,7 @@ runs:
824
986
  fi
825
987
  - id: upload_junit_artifact
826
988
  name: Upload Postman JUnit results
827
- 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'
828
990
  env:
829
991
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
830
992
  uses: actions/upload-artifact@v7.0.1
@@ -845,13 +1007,13 @@ runs:
845
1007
  environment-id: ${{ fromJSON(steps.repo_sync.outputs.environment-uids-json)[fromJSON(inputs.environments-json)[0]] }}
846
1008
  system-environment-id: ${{ fromJSON(inputs.system-env-map-json)[fromJSON(inputs.environments-json)[0]] }}
847
1009
  cluster-name: ${{ inputs.cluster-name }}
848
- postman-api-key: ${{ inputs.insights-postman-api-key }}
849
- 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 || '' }}
850
1012
  credential-preflight: ${{ inputs.credential-preflight }}
851
1013
  branch-strategy: ${{ inputs.branch-strategy }}
852
1014
  canonical-branch: ${{ inputs.canonical-branch }}
853
1015
  channels: ${{ inputs.channels }}
854
1016
  postman-team-id: ${{ inputs.postman-team-id }}
855
- github-token: ${{ inputs.github-token }}
1017
+ github-token: ${{ steps.branch_decision.outputs.tier != 'gated' && inputs.github-token || '' }}
856
1018
  postman-region: ${{ inputs.postman-region }}
857
1019
  postman-stack: ${{ inputs.postman-stack }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman-cs/onboarding-api",
3
- "version": "3.5.8",
3
+ "version": "3.5.10",
4
4
  "description": "Composite Postman API onboarding GitHub Action.",
5
5
  "files": [
6
6
  "action.yml",