@postman-cse/onboarding-bootstrap 0.13.1 → 0.14.1

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/README.md CHANGED
@@ -10,6 +10,7 @@ This action preserves the bootstrap slice of the API Catalog demo flow:
10
10
  - assign the workspace to a configured governance group when a group name and `postman-access-token` are provided
11
11
  - invite the requester and add workspace admins
12
12
  - upload or update a remote spec in Spec Hub (after normalizing operation summaries — see below)
13
+ - optionally check for OpenAPI breaking changes before any Postman mutations
13
14
  - lint the uploaded spec by UID with the Postman CLI
14
15
  - generate missing baseline, smoke, and contract collections or reuse existing ones
15
16
  - optionally refresh current collections from the latest spec or create release-scoped spec and collection assets
@@ -139,6 +140,39 @@ For Git-first workflows the spec is usually checked into the same repo that runs
139
140
 
140
141
  Only one of `spec-url` or `spec-path` may be set. When `spec-path` is used the action reads the file from disk, skips the URL-safety machinery, and still resolves any external HTTPS `$ref`s through the same hardened fetcher. Local-file `$ref`s are not followed.
141
142
 
143
+ ### OpenAPI breaking-change check
144
+
145
+ Breaking-change detection is disabled by default. Enable it with `breaking-change-mode` when you want bootstrap to compare the incoming OpenAPI contract before creating or updating Postman resources.
146
+
147
+ Modes:
148
+
149
+ - `off`: default. No comparison runs and `openapi-changes` is not installed.
150
+ - `previous-spec`: compares the incoming Spec Hub upload content with the existing `spec-id` content. If there is no previous spec, the check is marked `skipped`.
151
+ - `pr-native`: compares `breaking-target-ref` or the detected PR target branch version of `spec-path` against the checked-out working tree. If no target-branch spec is available, it falls back to `breaking-baseline-spec-path` when configured.
152
+ - `baseline-only`: compares `breaking-baseline-spec-path` against the incoming spec. If the baseline file is missing, the check is marked `skipped`.
153
+
154
+ The action installs a pinned `pb33f/openapi-changes` release into the runner temp directory, verifies the archive checksum, validates archive paths before extraction, and runs the binary by absolute path. It does not require customers to preinstall the tool, and it does not use `npx`, global npm installs, or `curl | sh`.
155
+
156
+ Summary and log files default to `$RUNNER_TEMP/postman-bootstrap/`, so they are runner files, not committed repo changes. The markdown summary is also appended to the GitHub job summary when `$GITHUB_STEP_SUMMARY` is available. Pass `breaking-summary-path` or `breaking-log-path` only if your workflow wants explicit file locations for later `actions/upload-artifact` steps.
157
+
158
+ Example:
159
+
160
+ ```yaml
161
+ - uses: actions/checkout@v5
162
+ with:
163
+ fetch-depth: 0
164
+ - uses: postman-cs/postman-bootstrap-action@v0
165
+ with:
166
+ project-name: core-payments
167
+ spec-path: apis/core-payments/openapi.yaml
168
+ breaking-change-mode: pr-native
169
+ breaking-target-ref: ${{ github.base_ref }}
170
+ breaking-baseline-spec-path: apis/core-payments/openapi.baseline.yaml
171
+ postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
172
+ ```
173
+
174
+ If breaking changes are detected, bootstrap fails before workspace, spec, or collection mutation. Missing comparison sources are reported as `skipped` and do not fail the run.
175
+
142
176
  ## Usage
143
177
 
144
178
  ```yaml
@@ -345,6 +379,12 @@ steps:
345
379
  | `workspace-team-id` | | Numeric sub-team ID for org-mode workspace creation. Required when the API key belongs to an org with multiple sub-teams. |
346
380
  | `spec-url` | | HTTPS URL to the OpenAPI document. Provide either `spec-url` or `spec-path`. |
347
381
  | `spec-path` | | Local filesystem path to the OpenAPI document, relative to the checked-out workspace (e.g. `apis/identity/openapi.yaml`). Use this when the spec lives in the repo and you don't want to host it over HTTPS. Provide either `spec-url` or `spec-path`. |
382
+ | `breaking-change-mode` | `off` | OpenAPI breaking-change comparison mode: `off`, `pr-native`, `baseline-only`, or `previous-spec`. |
383
+ | `breaking-baseline-spec-path` | | Workspace-relative baseline OpenAPI spec path used by `baseline-only` and as `pr-native` fallback. |
384
+ | `breaking-rules-path` | `changes-rules.yaml` | Workspace-relative `openapi-changes` rules file. Missing files are ignored. |
385
+ | `breaking-target-ref` | | Optional target branch or git ref override for `pr-native`. |
386
+ | `breaking-summary-path` | | Optional markdown report output path. Defaults to a runner-temp file. |
387
+ | `breaking-log-path` | | Optional raw command log output path. Defaults to a runner-temp file. |
348
388
  | `governance-group` | | Postman governance group name. Overrides the `postman-governance-group` repository custom property and legacy domain mapping. |
349
389
  | `governance-mapping-json` | `{}` | Legacy fallback map of `domain` value to Postman governance group name. Prefer the repository custom property or `governance-group`. |
350
390
  | `github-token` | | GitHub token used to read the `postman-governance-group` repository custom property. |
@@ -494,6 +534,8 @@ The `postman-access-token` is a Postman session token required for workspace enr
494
534
  - `contract-collection-id`
495
535
  - `collections-json`
496
536
  - `lint-summary-json`
537
+ - `breaking-change-status`
538
+ - `breaking-change-summary-json`
497
539
 
498
540
  ## Local development
499
541
 
package/action.yml CHANGED
@@ -66,6 +66,28 @@ inputs:
66
66
  description: OpenAPI specification version override (3.0 or 3.1). When not set, the version is auto-detected from the spec content.
67
67
  required: false
68
68
  default: ''
69
+ breaking-change-mode:
70
+ description: OpenAPI breaking-change comparison mode (off, pr-native, baseline-only, or previous-spec)
71
+ required: false
72
+ default: 'off'
73
+ breaking-baseline-spec-path:
74
+ description: Workspace-relative baseline OpenAPI spec path used by baseline-only mode and pr-native fallback
75
+ required: false
76
+ breaking-rules-path:
77
+ description: Workspace-relative openapi-changes rules file. Missing files are ignored.
78
+ required: false
79
+ default: changes-rules.yaml
80
+ breaking-target-ref:
81
+ description: Optional target branch or git ref override for pr-native breaking-change comparisons
82
+ required: false
83
+ breaking-summary-path:
84
+ description: Optional markdown report output path. Defaults to a runner-temp file.
85
+ required: false
86
+ default: ''
87
+ breaking-log-path:
88
+ description: Optional raw command log output path. Defaults to a runner-temp file.
89
+ required: false
90
+ default: ''
69
91
  governance-mapping-json:
70
92
  description: Legacy JSON map of business domain to governance group name. Prefer governance-group or the postman-governance-group repository custom property.
71
93
  required: false
@@ -121,6 +143,10 @@ outputs:
121
143
  description: JSON summary of generated collections
122
144
  lint-summary-json:
123
145
  description: JSON summary of lint errors and warnings
146
+ breaking-change-status:
147
+ description: OpenAPI breaking-change check status
148
+ breaking-change-summary-json:
149
+ description: JSON summary of the OpenAPI breaking-change check
124
150
  runs:
125
151
  using: node24
126
152
  main: dist/action.cjs