@postman-cs/onboarding-api 3.5.6 → 3.5.8

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 +34 -4
  2. package/package.json +1 -1
package/action.yml CHANGED
@@ -400,6 +400,28 @@ 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"
403
425
  - id: branch_decision
404
426
  name: Resolve immutable branch decision
405
427
  shell: bash
@@ -440,10 +462,11 @@ runs:
440
462
  if (!rules.some((rule) => rule.pattern === 'release/*')) rules.push({ pattern: 'release/*', code: 'RC' });
441
463
  channel = rules.find((rule) => rule.pattern.endsWith('*') ? headBranch?.startsWith(rule.pattern.slice(0, -1)) : headBranch === rule.pattern);
442
464
  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'; }
443
466
  else if (headBranch === canonicalBranch) { tier = 'canonical'; reason = `head branch equals canonical branch ${canonicalBranch}`; }
444
467
  else if (channel) { tier = 'channel'; reason = `branch ${headBranch} matches channel ${channel.pattern}=${channel.code}`; }
445
- else if (strategy === 'preview' && !isForkPr) { tier = 'preview'; reason = `branch ${headBranch} under branch-strategy preview`; }
446
- else { tier = 'gated'; reason = isForkPr ? 'fork PR: preview-ineligible, gated instead' : `branch ${headBranch} under branch-strategy publish-gate`; }
468
+ else if (strategy === 'preview') { tier = 'preview'; reason = `branch ${headBranch} under branch-strategy preview`; }
469
+ else { tier = 'gated'; reason = `branch ${headBranch} under branch-strategy publish-gate`; }
447
470
  }
448
471
  const decision = { tier, strategy, identity, canonicalBranch, ...(channel && tier === 'channel' ? { channel } : {}), reason };
449
472
  const serialized = JSON.stringify(decision);
@@ -458,6 +481,7 @@ runs:
458
481
  POSTMAN_REGION: ${{ inputs.postman-region }}
459
482
  POSTMAN_STACK: ${{ inputs.postman-stack }}
460
483
  WORKING_DIRECTORY: ${{ inputs.working-directory }}
484
+ SPEC_PATH: ${{ inputs.spec-path }}
461
485
  CREDENTIAL_PREFLIGHT: ${{ inputs.credential-preflight }}
462
486
  REPO_WRITE_MODE: ${{ inputs.repo-write-mode }}
463
487
  POSTMAN_API_KEY: ${{ inputs.postman-api-key }}
@@ -469,11 +493,17 @@ runs:
469
493
  INSIGHTS_POSTMAN_ACCESS_TOKEN: ${{ inputs.insights-postman-access-token }}
470
494
  run: |
471
495
  if [ -n "$WORKING_DIRECTORY" ]; then
472
- if ! node -e 'const fs=require("node:fs"),path=require("node:path");const target=path.resolve(process.env.GITHUB_WORKSPACE,process.env.WORKING_DIRECTORY);process.exit(fs.existsSync(target)&&fs.statSync(target).isDirectory()?0:1)'; then
496
+ 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
497
  echo "::error::working-directory does not exist under GITHUB_WORKSPACE. Create the directory or correct the input."
474
498
  exit 1
475
499
  fi
476
500
  fi
501
+ if [ -n "$SPEC_PATH" ]; then
502
+ 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
503
+ echo "::error::spec-path does not name a file under GITHUB_WORKSPACE. Check out the file and use a repository-relative path."
504
+ exit 1
505
+ fi
506
+ fi
477
507
  case "$POSTMAN_STACK" in
478
508
  prod|beta) ;;
479
509
  *)
@@ -523,7 +553,7 @@ runs:
523
553
  fi
524
554
  - id: bootstrap
525
555
  name: Bootstrap Postman Assets
526
- uses: postman-cs/postman-bootstrap-action@v2.21.3
556
+ uses: postman-cs/postman-bootstrap-action@v2.21.5
527
557
  env:
528
558
  POSTMAN_TEAM_ID: ${{ inputs.postman-team-id }}
529
559
  POSTMAN_BRANCH_DECISION: ${{ steps.branch_decision.outputs.branch-decision }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman-cs/onboarding-api",
3
- "version": "3.5.6",
3
+ "version": "3.5.8",
4
4
  "description": "Composite Postman API onboarding GitHub Action.",
5
5
  "files": [
6
6
  "action.yml",