@postman-cse/onboarding-repo-sync 2.0.0 → 2.1.0
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 +38 -67
- package/action.yml +4 -4
- package/dist/action.cjs +3357 -2609
- package/dist/cli.cjs +3364 -2619
- package/dist/index.cjs +3357 -2609
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -4,19 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
Exports Postman [collections](https://learning.postman.com/docs/use/use-collections/collections-schemas/) and [environments](https://learning.postman.com/docs/use/send-requests/variables/managing-environments/) into your repository and wires CI, [mock servers](https://learning.postman.com/docs/design-apis/mock-apis/set-up-mock-servers/), and [monitors](https://learning.postman.com/docs/monitoring-your-api/setting-up-monitor/) around them.
|
|
6
6
|
|
|
7
|
-
Part of the [Postman API Onboarding suite](https://github.com/postman-cs/postman-api-onboarding-action).
|
|
7
|
+
Part of the [Postman API Onboarding suite](https://github.com/postman-cs/postman-api-onboarding-action); the composite action's README has the full action-picker table.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
| Run the full onboarding flow from one workflow step | [Postman API Onboarding](https://github.com/postman-cs/postman-api-onboarding-action) |
|
|
14
|
-
| Mint a fresh service-account access token and team ID | [Postman Onboarding: Service Token](https://github.com/postman-cs/postman-resolve-service-token-action) |
|
|
15
|
-
| Create a workspace, upload an OpenAPI spec, and generate collections | [Postman Onboarding: Workspace Bootstrap](https://github.com/postman-cs/postman-bootstrap-action) |
|
|
16
|
-
| Export workspace artifacts into the repository and wire CI, mocks, and monitors | This action |
|
|
17
|
-
| Discover OpenAPI specs from AWS services | [Postman Onboarding: AWS Spec Discovery](https://github.com/postman-cs/postman-aws-spec-discovery-action) |
|
|
18
|
-
| Apply the curated smoke-test flow to an existing Smoke collection | [Postman Onboarding: Smoke Flow](https://github.com/postman-cs/postman-smoke-flow-action) |
|
|
19
|
-
| Link Postman Insights services to an onboarding workspace | [Postman Onboarding: Insights Linking](https://github.com/postman-cs/postman-insights-onboarding-action) |
|
|
9
|
+
- [Usage](#usage)
|
|
10
|
+
- [Examples](#examples)
|
|
11
|
+
- [Inputs](#inputs) / [Outputs](#outputs)
|
|
12
|
+
- [How it works](#how-it-works)
|
|
20
13
|
|
|
21
14
|
## Usage
|
|
22
15
|
|
|
@@ -165,7 +158,7 @@ with:
|
|
|
165
158
|
| `committer-name` | Git committer name for sync commits. | no | `Postman` |
|
|
166
159
|
| `committer-email` | Git committer email for sync commits. | no | `support@postman.com` |
|
|
167
160
|
| `postman-api-key` | Postman API key (PMAK). Used only to mint/re-mint the access token (via postman-resolve-service-token-action) and for the Postman CLI spec-lint login. Asset operations (environments, collections, mocks, monitors) run on the access-token gateway and do not use the PMAK. Optional when a valid postman-access-token is supplied; required only for the CLI lint path. | no | |
|
|
168
|
-
| `postman-access-token` | Postman access token minted by postman-resolve-service-token-action. Required for all asset operations (environment create/get/update, collection read, mock, monitor) which run through the access-token gateway. Also used for workspace linking, system environment association, and generated API-key creation.
|
|
161
|
+
| `postman-access-token` | Postman access token minted by postman-resolve-service-token-action. Required for all asset operations (environment create/get/update, collection read, mock, monitor) which run through the access-token gateway. Also used for workspace linking, system environment association, and generated API-key creation. When omitted, the action mints one from postman-api-key (service-account PMAK); if that mint also fails the action fails fast — PMAK is never an asset-routing fallback. | no | |
|
|
169
162
|
| `team-id` | Postman team ID resolved by postman-resolve-service-token-action. Primary team scope for all downstream actions; included as x-entity-team-id in org-mode Bifrost calls. Falls back to POSTMAN_TEAM_ID when omitted. Set explicitly for org-mode teams. | no | `""` |
|
|
170
163
|
| `credential-preflight` | Credential identity preflight policy. warn (default) logs a note and continues when postman-api-key and postman-access-token resolve to different parent orgs; enforce fails the run on that condition before any workspace is created. Both modes warn when postman-access-token is not a service-account token. | no | `warn` |
|
|
171
164
|
| `github-token` | GitHub token used for repo variable persistence and commits. | no | |
|
|
@@ -176,8 +169,8 @@ with:
|
|
|
176
169
|
| `ssl-client-key` | Base64-encoded PEM client private key for Postman CLI mTLS runs. | no | |
|
|
177
170
|
| `ssl-client-passphrase` | Optional passphrase for encrypted ssl-client-key. | no | |
|
|
178
171
|
| `ssl-extra-ca-certs` | Optional base64-encoded PEM CA certificate bundle for custom trust. | no | |
|
|
179
|
-
| `spec-id` | Spec UID
|
|
180
|
-
| `spec-path` | Optional repo-root-relative path to the local
|
|
172
|
+
| `spec-id` | Spec Hub UID emitted by bootstrap's spec-id output. When set, it is persisted into .postman/resources.yaml cloudResources so later runs and the generated CI workflow can resolve the spec without re-discovery. | no | |
|
|
173
|
+
| `spec-path` | Optional repo-root-relative path to the local OpenAPI file. Recorded in .postman/resources.yaml and .postman/workflows.yaml metadata so the committed artifacts point back at the spec source in this repository; the file itself is not uploaded by this action. | no | |
|
|
181
174
|
| `postman-region` | Postman data residency region for public API and Postman CLI calls. One of: us or eu. | no | `us` |
|
|
182
175
|
<!-- inputs-table:end -->
|
|
183
176
|
|
|
@@ -226,6 +219,35 @@ postman/environments/
|
|
|
226
219
|
resources.yaml
|
|
227
220
|
```
|
|
228
221
|
|
|
222
|
+
```mermaid
|
|
223
|
+
flowchart LR
|
|
224
|
+
subgraph SYNC["repo-sync: once per onboarding run"]
|
|
225
|
+
W["Postman workspace"] -->|"gateway v3 export"| ART["postman/ + .postman/<br/>committed artifacts"]
|
|
226
|
+
ART --> WF["generated CI workflow"]
|
|
227
|
+
W --> MM["mock server +<br/>smoke monitor"]
|
|
228
|
+
end
|
|
229
|
+
subgraph LOOP["customer CI: every push / PR / 6h schedule"]
|
|
230
|
+
WF --> RUN["postman collection run<br/>Smoke then Contract"]
|
|
231
|
+
RES[".postman/resources.yaml<br/>collection UIDs + environment"] --> RUN
|
|
232
|
+
RUN --> API["live API or mock<br/>environment baseUrl"]
|
|
233
|
+
API --> REP["pass/fail per assertion<br/>+ --report-events to<br/>Postman run history"]
|
|
234
|
+
end
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
This is the execution half of the suite's contract-testing story: bootstrap injects the spec-derived `pm.test()` assertions into the collections, and the workflow this action generates is what actually runs them against a live target on every push and on schedule. See [bootstrap's Contract Enforcement Layers](https://github.com/postman-cs/postman-bootstrap-action/blob/main/docs/contract-enforcement-layers.md) for the full two-layer model.
|
|
238
|
+
|
|
239
|
+
### What the generated CI workflow runs
|
|
240
|
+
|
|
241
|
+
When CI workflow generation is enabled, the committed GitHub Actions workflow runs on every push and pull request to `main` and on a six-hour schedule. Each run:
|
|
242
|
+
|
|
243
|
+
1. Checks out the repository and installs the Postman CLI from the region-appropriate install URL.
|
|
244
|
+
2. Logs the Postman CLI in with the `POSTMAN_API_KEY` repository secret (this action mints and stores that secret when repository write access allows).
|
|
245
|
+
3. Resolves the `[Smoke]` and `[Contract]` collection UIDs and the environment UID from the committed `.postman/resources.yaml`, failing fast if any are missing.
|
|
246
|
+
4. Decodes optional mTLS client certificates from the `POSTMAN_SSL_*` secrets and passes them to the runs.
|
|
247
|
+
5. Runs the `[Smoke]` collection and then the `[Contract]` collection with `postman collection run` against the resolved environment, with `--report-events` so results land in the Postman cloud run history, and with `CI_ENVIRONMENT` (the `CI_ENVIRONMENT` repository variable, default `Production`) available to scripts.
|
|
248
|
+
|
|
249
|
+
A matching Azure DevOps Pipelines template is generated for Azure DevOps repositories. The assertions those collections execute are generated upstream: the per-check reference is in [postman-bootstrap-action's Generated Assertions](https://github.com/postman-cs/postman-bootstrap-action/blob/main/docs/generated-assertions.md), and the curated Smoke journey scripts are in [postman-smoke-flow-action's Generated Test Scripts](https://github.com/postman-cs/postman-smoke-flow-action/blob/main/docs/generated-tests.md).
|
|
250
|
+
|
|
229
251
|
For `commit-and-push`, the push target is resolved from `current-ref`, then `GITHUB_HEAD_REF`, then `GITHUB_REF_NAME`. Pull request merge refs are normalized to the PR head branch.
|
|
230
252
|
|
|
231
253
|
Mocks and monitors: when `baseline-collection-id`, `workspace-id`, and at least one environment are available, the action creates or reuses a mock server. When `smoke-collection-id` is also available, it creates or reuses a cloud smoke monitor unless `monitor-type: cli` is set. With an empty `monitor-cron`, a new cloud monitor is created disabled and triggered once per workflow invocation.
|
|
@@ -241,64 +263,13 @@ Deeper reference:
|
|
|
241
263
|
|
|
242
264
|
## Resources
|
|
243
265
|
|
|
244
|
-
### The suite
|
|
245
|
-
|
|
246
|
-
| Action | Role |
|
|
247
|
-
| --- | --- |
|
|
248
|
-
| [Postman API Onboarding](https://github.com/postman-cs/postman-api-onboarding-action) | Entry point: chains workspace bootstrap, repo sync, and optional Insights linking |
|
|
249
|
-
| [Postman Onboarding: Service Token](https://github.com/postman-cs/postman-resolve-service-token-action) | Mints the service-account access token and team ID |
|
|
250
|
-
| [Postman Onboarding: AWS Spec Discovery](https://github.com/postman-cs/postman-aws-spec-discovery-action) | Discovers and exports API specs from AWS services |
|
|
251
|
-
| [Postman Onboarding: Workspace Bootstrap](https://github.com/postman-cs/postman-bootstrap-action) | Creates the workspace, uploads the spec, generates collections |
|
|
252
|
-
| [Postman Onboarding: Smoke Flow](https://github.com/postman-cs/postman-smoke-flow-action) | Applies a curated flow.yaml to the Smoke collection |
|
|
253
|
-
| [Postman Onboarding: Repo Sync](https://github.com/postman-cs/postman-repo-sync-action) | Exports artifacts into the repo and wires CI, mocks, and monitors |
|
|
254
|
-
| [Postman Onboarding: Insights Linking](https://github.com/postman-cs/postman-insights-onboarding-action) | Links Insights discovered services to the workspace |
|
|
255
|
-
|
|
256
|
-
- [postman-resolve-service-token-action](https://github.com/postman-cs/postman-resolve-service-token-action): mints a service-account access token and team ID.
|
|
257
|
-
- [postman-api-onboarding-action](https://github.com/postman-cs/postman-api-onboarding-action): composite action that orchestrates the onboarding pipeline.
|
|
258
|
-
- [postman-bootstrap-action](https://github.com/postman-cs/postman-bootstrap-action): workspace provisioning, spec upload, and collection generation.
|
|
259
|
-
- [postman-smoke-flow-action](https://github.com/postman-cs/postman-smoke-flow-action): applies a curated flow.yaml to the Smoke collection.
|
|
260
|
-
- [postman-insights-onboarding-action](https://github.com/postman-cs/postman-insights-onboarding-action): links Postman Insights to a workspace.
|
|
261
|
-
- [postman-aws-spec-discovery-action](https://github.com/postman-cs/postman-aws-spec-discovery-action): discovers API specs in AWS accounts.
|
|
262
266
|
- npm package: [@postman-cse/onboarding-repo-sync](https://www.npmjs.com/package/@postman-cse/onboarding-repo-sync)
|
|
263
267
|
- Postman API and auth references: [Postman API](https://learning.postman.com/docs/reference/postman-api/intro-api/), [API authentication](https://learning.postman.com/docs/reference/postman-api/authentication/), [Postman CLI auth](https://learning.postman.com/docs/postman-cli/postman-cli-auth/), [EU data residency](https://learning.postman.com/docs/administration/enterprise/about-eu-data-residency/)
|
|
264
268
|
- Postman artifact and runtime references: [Collection v3 schema](https://learning.postman.com/docs/use/use-collections/collections-schemas/), [Postman CLI collection runs](https://learning.postman.com/docs/postman-cli/postman-cli-run-collection/), [environments](https://learning.postman.com/docs/use/send-requests/variables/managing-environments/), [mock servers](https://learning.postman.com/docs/design-apis/mock-apis/set-up-mock-servers/), [monitors](https://learning.postman.com/docs/monitoring-your-api/setting-up-monitor/)
|
|
265
269
|
|
|
266
|
-
|
|
267
270
|
## Telemetry
|
|
268
271
|
|
|
269
|
-
|
|
270
|
-
Postman team can measure adoption across CI systems. The event contains the
|
|
271
|
-
action name and version, your Postman team ID, the detected CI provider and
|
|
272
|
-
runner kind, the run outcome, the CI run identifier, an event timestamp, and a one-way SHA-256 hash of the repository
|
|
273
|
-
identifier. Each event also carries a schema version and a constant event marker (always `completion`). The Postman team ID is sent in the clear on a legitimate-interest
|
|
274
|
-
basis to measure product adoption.
|
|
275
|
-
|
|
276
|
-
The `events.pm-cse.dev` endpoint is operated by the Postman Customer Success
|
|
277
|
-
Engineering team. Postman, Inc. processes these events only to measure
|
|
278
|
-
onboarding adoption in aggregate, retains them only as aggregated counts for
|
|
279
|
-
product-adoption trend analysis, and includes no payload field that identifies
|
|
280
|
-
an individual person.
|
|
281
|
-
|
|
282
|
-
It never sends API keys, access tokens, spec content, workspace or repository
|
|
283
|
-
names, or any personal data. It is fire-and-forget with a hard
|
|
284
|
-
timeout and can never block or fail your pipeline. Corporate HTTP and HTTPS
|
|
285
|
-
proxies are honored through the standard `HTTPS_PROXY`, `HTTP_PROXY`, and
|
|
286
|
-
`NO_PROXY` environment variables.
|
|
287
|
-
|
|
288
|
-
Disable it by setting either environment variable in your CI:
|
|
289
|
-
|
|
290
|
-
```sh
|
|
291
|
-
POSTMAN_ACTIONS_TELEMETRY=off
|
|
292
|
-
# or the cross-tool standard
|
|
293
|
-
DO_NOT_TRACK=1
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
Telemetry is also skipped automatically when no Postman team ID can be resolved.
|
|
297
|
-
|
|
298
|
-
Events are sent over HTTPS to `https://events.pm-cse.dev/v1/events`. To
|
|
299
|
-
allowlist this destination on a restricted network, or to route events to a
|
|
300
|
-
collector you operate, set the `POSTMAN_ACTIONS_TELEMETRY_ENDPOINT` environment
|
|
301
|
-
variable to your own URL.
|
|
272
|
+
The action sends one anonymous usage event per run (action name/version, outcome, coarse CI metadata; never secrets, spec content, or repo names). Disable with `POSTMAN_ACTIONS_TELEMETRY=off` or `DO_NOT_TRACK=1`; route events to your own collector with `POSTMAN_ACTIONS_TELEMETRY_ENDPOINT`.
|
|
302
273
|
|
|
303
274
|
## License
|
|
304
275
|
|
package/action.yml
CHANGED
|
@@ -112,8 +112,8 @@ inputs:
|
|
|
112
112
|
description: Postman API key (PMAK). Used only to mint/re-mint the access token (via postman-resolve-service-token-action) and for the Postman CLI spec-lint login. Asset operations (environments, collections, mocks, monitors) run on the access-token gateway and do not use the PMAK. Optional when a valid postman-access-token is supplied; required only for the CLI lint path.
|
|
113
113
|
required: false
|
|
114
114
|
postman-access-token:
|
|
115
|
-
description: Postman access token minted by postman-resolve-service-token-action. Required for all asset operations (environment create/get/update, collection read, mock, monitor) which run through the access-token gateway. Also used for workspace linking, system environment association, and generated API-key creation.
|
|
116
|
-
required:
|
|
115
|
+
description: Postman access token minted by postman-resolve-service-token-action. Required for all asset operations (environment create/get/update, collection read, mock, monitor) which run through the access-token gateway. Also used for workspace linking, system environment association, and generated API-key creation. When omitted, the action mints one from postman-api-key (service-account PMAK); if that mint also fails the action fails fast — PMAK is never an asset-routing fallback.
|
|
116
|
+
required: false
|
|
117
117
|
team-id:
|
|
118
118
|
description: Postman team ID resolved by postman-resolve-service-token-action. Primary team scope for all downstream actions; included as x-entity-team-id in org-mode Bifrost calls. Falls back to POSTMAN_TEAM_ID when omitted. Set explicitly for org-mode teams.
|
|
119
119
|
required: false
|
|
@@ -148,10 +148,10 @@ inputs:
|
|
|
148
148
|
description: Optional base64-encoded PEM CA certificate bundle for custom trust.
|
|
149
149
|
required: false
|
|
150
150
|
spec-id:
|
|
151
|
-
description: Spec UID
|
|
151
|
+
description: Spec Hub UID emitted by bootstrap's spec-id output. When set, it is persisted into .postman/resources.yaml cloudResources so later runs and the generated CI workflow can resolve the spec without re-discovery.
|
|
152
152
|
required: false
|
|
153
153
|
spec-path:
|
|
154
|
-
description: Optional repo-root-relative path to the local
|
|
154
|
+
description: Optional repo-root-relative path to the local OpenAPI file. Recorded in .postman/resources.yaml and .postman/workflows.yaml metadata so the committed artifacts point back at the spec source in this repository; the file itself is not uploaded by this action.
|
|
155
155
|
required: false
|
|
156
156
|
postman-region:
|
|
157
157
|
description: "Postman data residency region for public API and Postman CLI calls. One of: us or eu."
|