@postman-cse/onboarding-bootstrap 0.13.0 → 0.13.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 +62 -18
- package/action.yml +17 -5
- package/dist/action.cjs +63405 -0
- package/dist/cli.cjs +4760 -6115
- package/dist/index.cjs +8733 -8302
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# postman-bootstrap-action
|
|
2
2
|
|
|
3
|
-
Public
|
|
3
|
+
Public customer preview GitHub Action for Postman workspace bootstrap from a registry-backed OpenAPI spec.
|
|
4
4
|
|
|
5
5
|
## Scope
|
|
6
6
|
|
|
7
7
|
This action preserves the bootstrap slice of the API Catalog demo flow:
|
|
8
8
|
|
|
9
9
|
- create or reuse a Postman workspace
|
|
10
|
-
- assign the workspace to a governance group
|
|
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
13
|
- lint the uploaded spec by UID with the Postman CLI
|
|
@@ -16,12 +16,12 @@ This action preserves the bootstrap slice of the API Catalog demo flow:
|
|
|
16
16
|
- inject generated tests and apply collection tags
|
|
17
17
|
- reuse committed `.postman/resources.yaml` state from the checked-out ref when present
|
|
18
18
|
|
|
19
|
-
The public
|
|
19
|
+
The public customer preview contract uses kebab-case inputs and outputs and defaults `integration-backend` to `bifrost`.
|
|
20
20
|
|
|
21
21
|
### Git provider support
|
|
22
22
|
|
|
23
23
|
Workspace-to-repository linking via Bifrost supports both **GitHub** and **GitLab** (cloud and self-hosted) repository URLs. The `repo-url` value (or the auto-derived URL from CI environment variables) is stored as-is by Bifrost without provider-specific validation. URL normalization handles HTTPS, SSH (`git@`), and `.git` suffix variants for both providers.
|
|
24
|
-
The public
|
|
24
|
+
The public customer preview contract uses kebab-case inputs and outputs and defaults `integration-backend` to `bifrost`.
|
|
25
25
|
|
|
26
26
|
For existing services, pass `workspace-id`, `spec-id`, and any existing collection IDs to rerun the bootstrap safely without creating duplicate Postman assets. When `.postman/resources.yaml` is present in the checked-out ref, the action also reuses its workspace/spec/collection mappings automatically.
|
|
27
27
|
|
|
@@ -87,6 +87,30 @@ postman-bootstrap --workspace-team-id 132319 ...
|
|
|
87
87
|
Or via environment variable: `export POSTMAN_WORKSPACE_TEAM_ID=132319`
|
|
88
88
|
|
|
89
89
|
Non-org accounts (single team) are unaffected and do not need this input.
|
|
90
|
+
|
|
91
|
+
### Governance group assignment
|
|
92
|
+
|
|
93
|
+
Governance assignment is optional and customer-configured:
|
|
94
|
+
|
|
95
|
+
1. Set the repository custom property `postman-governance-group` to the Postman governance group name.
|
|
96
|
+
2. Set `postman-access-token` so the action can perform workspace enrichment after the workspace exists.
|
|
97
|
+
|
|
98
|
+
Example:
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
with:
|
|
102
|
+
github-token: ${{ github.token }}
|
|
103
|
+
postman-access-token: ${{ secrets.POSTMAN_ACCESS_TOKEN }}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
For one-off runs, `governance-group` can be passed directly and overrides the
|
|
107
|
+
repository custom property. `governance-mapping-json` remains supported as a
|
|
108
|
+
domain-map fallback for older workflows.
|
|
109
|
+
|
|
110
|
+
If the group configuration is missing, the group is not found, or the access token is
|
|
111
|
+
expired, bootstrap logs a warning and continues with the created workspace,
|
|
112
|
+
spec, and collections.
|
|
113
|
+
|
|
90
114
|
### OpenAPI operation summaries (normalization)
|
|
91
115
|
|
|
92
116
|
Before upload to Spec Hub, the action parses JSON or YAML OpenAPI documents and adjusts **path operations** so collection generation is less likely to fail:
|
|
@@ -100,6 +124,21 @@ This runs in `src/index.ts` before upload. If nothing under `paths` needs changi
|
|
|
100
124
|
|
|
101
125
|
The root `spec-url` must be HTTPS and is fetched with pinned DNS resolution. The action blocks credential-bearing URLs, localhost/private/link-local/internal destinations, unsafe redirects, DNS rebinding attempts, and oversized OpenAPI resources before uploading content to Spec Hub. Root fetches are capped at 25 MiB, and fetch errors redact URL credentials, query strings, and fragments before logging.
|
|
102
126
|
|
|
127
|
+
### Loading the spec from the workspace (`spec-path`)
|
|
128
|
+
|
|
129
|
+
For Git-first workflows the spec is usually checked into the same repo that runs the action, so an HTTPS URL is redundant (or impossible without making the repo public). Pass `spec-path` instead of `spec-url` to read the document directly from the checked-out workspace:
|
|
130
|
+
|
|
131
|
+
```yaml
|
|
132
|
+
- uses: actions/checkout@v5
|
|
133
|
+
- uses: postman-cs/postman-bootstrap-action@v0
|
|
134
|
+
with:
|
|
135
|
+
project-name: core-payments
|
|
136
|
+
spec-path: apis/core-payments/openapi.yaml
|
|
137
|
+
postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
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
|
+
|
|
103
142
|
## Usage
|
|
104
143
|
|
|
105
144
|
```yaml
|
|
@@ -110,7 +149,7 @@ jobs:
|
|
|
110
149
|
actions: write
|
|
111
150
|
contents: read
|
|
112
151
|
steps:
|
|
113
|
-
- uses: actions/checkout@
|
|
152
|
+
- uses: actions/checkout@v5
|
|
114
153
|
- uses: postman-cs/postman-bootstrap-action@v0
|
|
115
154
|
with:
|
|
116
155
|
project-name: core-payments
|
|
@@ -119,14 +158,14 @@ jobs:
|
|
|
119
158
|
requester-email: owner@example.com
|
|
120
159
|
workspace-admin-user-ids: 101,102
|
|
121
160
|
spec-url: https://example.com/openapi.yaml
|
|
122
|
-
|
|
161
|
+
github-token: ${{ github.token }}
|
|
123
162
|
postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
|
|
124
163
|
postman-access-token: ${{ secrets.POSTMAN_ACCESS_TOKEN }}
|
|
125
164
|
|
|
126
165
|
bootstrap-existing:
|
|
127
166
|
runs-on: ubuntu-latest
|
|
128
167
|
steps:
|
|
129
|
-
- uses: actions/checkout@
|
|
168
|
+
- uses: actions/checkout@v5
|
|
130
169
|
- uses: postman-cs/postman-bootstrap-action@v0
|
|
131
170
|
with:
|
|
132
171
|
project-name: core-payments
|
|
@@ -190,6 +229,7 @@ Rollback behavior:
|
|
|
190
229
|
| `CONTRACT_REF_DEPTH_EXCEEDED` | Ref nesting exceeded the configured limit. | Flatten recursive/deep ref chains. |
|
|
191
230
|
| `CONTRACT_REF_SIZE_EXCEEDED` | A fetched resource or total fetched bytes exceeded limits. | Reduce spec/ref size or pre-bundle the document. |
|
|
192
231
|
| `CONTRACT_SPEC_PARSE_FAILED` | The fetched document was not valid JSON/YAML object content. | Fix the source document syntax. |
|
|
232
|
+
| `CONTRACT_SPEC_READ_FAILED` | The `spec-path` file could not be read from the workspace. | Verify the file exists at the configured path and that the workflow checked out the branch that contains it. |
|
|
193
233
|
| `CONTRACT_SPEC_VALIDATION_FAILED` | The bundled document failed OpenAPI validation. | Fix OpenAPI validation errors. |
|
|
194
234
|
| `CONTRACT_UNSUPPORTED_OPENAPI_VERSION` | The document was not OpenAPI 3.0 or 3.1. | Provide an OpenAPI 3.0/3.1 document. |
|
|
195
235
|
| `CONTRACT_NO_ELIGIBLE_OPERATIONS` | No eligible `paths` operations with responses were found. | Add path operations with responses. |
|
|
@@ -298,16 +338,20 @@ steps:
|
|
|
298
338
|
| `spec-sync-mode` | `update` | Spec lifecycle policy. `update` keeps one canonical spec current in Spec Hub, while `version` creates or reuses a release-scoped spec asset. |
|
|
299
339
|
| `release-label` | | Optional release label used for versioned specs and collections. When omitted for versioned sync, the action derives one from GitHub tag or branch metadata. |
|
|
300
340
|
| `project-name` | | Service name used in workspace and asset naming. |
|
|
301
|
-
| `domain` | | Business domain used
|
|
341
|
+
| `domain` | | Business domain metadata. Also used by the legacy `governance-mapping-json` fallback. |
|
|
302
342
|
| `domain-code` | | Short prefix used when constructing the workspace name. |
|
|
303
343
|
| `requester-email` | | Optional user invited into the workspace. |
|
|
304
344
|
| `workspace-admin-user-ids` | | Comma-separated Postman user IDs to grant admin access. |
|
|
305
345
|
| `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. |
|
|
306
|
-
| `spec-url` | |
|
|
307
|
-
| `
|
|
346
|
+
| `spec-url` | | HTTPS URL to the OpenAPI document. Provide either `spec-url` or `spec-path`. |
|
|
347
|
+
| `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`. |
|
|
348
|
+
| `governance-group` | | Postman governance group name. Overrides the `postman-governance-group` repository custom property and legacy domain mapping. |
|
|
349
|
+
| `governance-mapping-json` | `{}` | Legacy fallback map of `domain` value to Postman governance group name. Prefer the repository custom property or `governance-group`. |
|
|
350
|
+
| `github-token` | | GitHub token used to read the `postman-governance-group` repository custom property. |
|
|
351
|
+
| `gh-fallback-token` | | Fallback GitHub token used to read repository custom properties when `github-token` cannot. |
|
|
308
352
|
| `postman-api-key` | | Required for all Postman asset operations. |
|
|
309
|
-
| `postman-access-token` | | Required for governance assignment and canonical workspace validation during reruns. |
|
|
310
|
-
| `integration-backend` | `bifrost` | Current public
|
|
353
|
+
| `postman-access-token` | | Required for governance assignment, cloud spec-to-collection syncing, and canonical workspace validation during reruns. |
|
|
354
|
+
| `integration-backend` | `bifrost` | Current public customer preview backend. |
|
|
311
355
|
|
|
312
356
|
## Lifecycle Modes
|
|
313
357
|
|
|
@@ -406,11 +450,11 @@ The `postman-api-key` is a Postman API key (PMAK) used for all standard Postman
|
|
|
406
450
|
|
|
407
451
|
> **Note:** The PMAK is a long-lived key tied to your Postman account. It does not require periodic renewal like the `postman-access-token`.
|
|
408
452
|
|
|
409
|
-
### Obtaining `postman-access-token` (
|
|
453
|
+
### Obtaining `postman-access-token` (Customer Preview)
|
|
410
454
|
|
|
411
|
-
> **⚠️
|
|
455
|
+
> **⚠️ Customer Preview limitation:** The `postman-access-token` input requires a manually-extracted session token. There is currently no public API to exchange a Postman API key (PMAK) for an access token programmatically. This manual step will be eliminated before GA.
|
|
412
456
|
|
|
413
|
-
The `postman-access-token` is a Postman session token
|
|
457
|
+
The `postman-access-token` is a Postman session token required for workspace enrichment operations that the standard PMAK API key cannot perform, including governance group assignment, cloud spec-to-collection syncing, and canonical workspace validation during reruns. Without it, those steps degrade to warning-based behavior and name-based workspace fallback during provisioning.
|
|
414
458
|
|
|
415
459
|
**To obtain and configure the token:**
|
|
416
460
|
|
|
@@ -462,11 +506,11 @@ npm run build
|
|
|
462
506
|
|
|
463
507
|
`npm run build` produces the committed `dist/index.cjs` action bundle used by `action.yml`.
|
|
464
508
|
|
|
465
|
-
##
|
|
509
|
+
## Customer Preview Release Strategy
|
|
466
510
|
|
|
467
|
-
-
|
|
511
|
+
- Customer Preview channel tags use `v0.x.y`.
|
|
468
512
|
- Consumers can pin immutable tags such as `v0.2.0` for reproducibility.
|
|
469
|
-
- Moving tag `v0` is used only as the rolling
|
|
513
|
+
- Moving tag `v0` is used only as the rolling customer preview channel.
|
|
470
514
|
|
|
471
515
|
## REST Migration Seam
|
|
472
516
|
|
package/action.yml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: postman-bootstrap-action
|
|
2
|
-
description: Public
|
|
2
|
+
description: Public customer preview action contract for Postman workspace, spec, and collection bootstrap.
|
|
3
3
|
inputs:
|
|
4
4
|
|
|
5
5
|
workspace-id:
|
|
@@ -41,6 +41,9 @@ inputs:
|
|
|
41
41
|
domain-code:
|
|
42
42
|
description: Workspace naming prefix
|
|
43
43
|
required: false
|
|
44
|
+
governance-group:
|
|
45
|
+
description: Postman governance workspace group name. Overrides the postman-governance-group repository custom property and domain mapping.
|
|
46
|
+
required: false
|
|
44
47
|
requester-email:
|
|
45
48
|
description: Requester email for audit context
|
|
46
49
|
required: false
|
|
@@ -54,16 +57,25 @@ inputs:
|
|
|
54
57
|
this input to see available sub-teams listed in the error output.
|
|
55
58
|
required: false
|
|
56
59
|
spec-url:
|
|
57
|
-
description: URL to the OpenAPI document to bootstrap
|
|
58
|
-
required:
|
|
60
|
+
description: HTTPS URL to the OpenAPI document to bootstrap. Provide either spec-url or spec-path.
|
|
61
|
+
required: false
|
|
62
|
+
spec-path:
|
|
63
|
+
description: Local filesystem path to the OpenAPI document (relative to the workspace). Provide either spec-url or spec-path.
|
|
64
|
+
required: false
|
|
59
65
|
openapi-version:
|
|
60
66
|
description: OpenAPI specification version override (3.0 or 3.1). When not set, the version is auto-detected from the spec content.
|
|
61
67
|
required: false
|
|
62
68
|
default: ''
|
|
63
69
|
governance-mapping-json:
|
|
64
|
-
description: JSON map of business domain to governance group name
|
|
70
|
+
description: Legacy JSON map of business domain to governance group name. Prefer governance-group or the postman-governance-group repository custom property.
|
|
65
71
|
required: false
|
|
66
72
|
default: '{}'
|
|
73
|
+
github-token:
|
|
74
|
+
description: GitHub token used to read the postman-governance-group repository custom property
|
|
75
|
+
required: false
|
|
76
|
+
gh-fallback-token:
|
|
77
|
+
description: Fallback GitHub token used to read repository custom properties when github-token cannot
|
|
78
|
+
required: false
|
|
67
79
|
postman-api-key:
|
|
68
80
|
description: Postman API key used for bootstrap operations
|
|
69
81
|
required: true
|
|
@@ -111,4 +123,4 @@ outputs:
|
|
|
111
123
|
description: JSON summary of lint errors and warnings
|
|
112
124
|
runs:
|
|
113
125
|
using: node24
|
|
114
|
-
main: dist/
|
|
126
|
+
main: dist/action.cjs
|