Start the same mock with postman mock run against your scenario .js file, add a CI workflow, push to your public fork, and confirm the GitHub Action health-checks the mock.
Start the Mock with the Postman CLI
Use postman mock run against the scenario .js file (not the mock folder — a directory fails with EISDIR). Same command you'll use in CI.
-
If the mock is still running in the Postman UI, click Stop so the port is free. Keep the real Deskly Express app stopped as well.
-
Open the Postman terminal (or any terminal) in your connected
deskly-apifolder. -
Confirm the Postman CLI is available:
postman --versionIf the command isn't found, install the CLI from the Postman CLI docs, then retry.
-
Find your mock's scenario script and the port it listens on. In Files, expand
postman/mocks/— you should see a folder for Deskly Mock containingconfig.yamland a.jsfile (oftendefault.js). Openconfig.yamland note the port (commonly4500). -
Start the mock by pointing at that
.jsfile (adjust the folder and filename if yours differ):postman mock run ./postman/mocks/deskly-mock/default.jsCaution: Pass the scenario
.jspath, not the mock directory and notconfig.yaml. The CLI uses the port fromconfig.yaml. -
In a second terminal (or a new Postman request), hit the mock on the port from
config.yaml:curl http://localhost:4500/healthSwap
4500for whatever port yourconfig.yamllists. Expect a successful JSON response from your handler — still with nonpm startfor Deskly. -
Stop the CLI mock with Ctrl+C when you're finished.
Troubleshooting
EISDIR: illegal operation on a directory, read— you pointedpostman mock runat a folder. Use the full path to the scenario.jsfile instead.- Connection refused — confirm the port in the curl matches
config.yaml, and that nothing else (including the Postman UI mock) is already bound to it.
Reference: Mock server commands (postman mock run).
Add a CI Workflow and Push Your Mock to GitHub
Add a GitHub Actions workflow, push the mock and workflow to a feature/ branch, then open the Action run and confirm the health check hit your mock.
-
In your editor (or the Postman Files tree), create a workflow file under
.github/workflows/named eitherdeskly-mock-ci.ymlordeskly-mock-ci.yaml— both extensions are valid. Use content like:name: Deskly mock smoke on: push: branches: ["feature/**"] pull_request: jobs: mock-smoke: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: "24" - name: Install Postman CLI run: npm install -g postman-cli # Stand-in for Deskly — no npm install / npm start for the Express app. # Point at the scenario .js file (not the mock directory). # The trailing & starts the mock in the background so the next steps can curl it. - name: Start Deskly mock run: postman mock run ./postman/mocks/deskly-mock/default.js & - name: Wait for mock run: | for i in $(seq 1 30); do if curl -sf http://localhost:4500/health; then exit 0 fi sleep 1 done echo "Mock did not become ready in time" >&2 exit 1 - name: Smoke request against mock run: curl -sf http://localhost:4500/health -
Adjust the
.jspath and port in the workflow if your mock folder, scenario filename, orconfig.yamlport differ. The&at the end of the start step is intentional — it runs the mock in the background so the wait/smoke steps can hit it in the same job. Notice there is no step that runs Deskly'snpm start— in a fuller pipeline you might follow this withpostman collection runpointed at the same mock base URL. -
Open the Postman terminal and confirm you're in your connected
deskly-apifolder. -
Stay on your current
feature/branch, or create one dedicated to the mock:git checkout -b feature/deskly-mock -
Review what changed:
git status -uExpect new or modified files under
postman/mocks/(and possibly.postman/resources.yaml) plus.github/workflows/deskly-mock-ci.ymlor.github/workflows/deskly-mock-ci.yaml. -
Stage, commit, and push to your fork:
git add . git commit -m "Add Deskly coded mock stand-in via Native Git" git push -u origin HEAD -
On GitHub, open your
deskly-apifork → Actions. Select the Deskly mock smoke workflow run for the commit you just pushed on yourfeature/branch (if Actions asks you to enable workflows on the fork, turn them on and re-run or push an empty commit). -
Open that run and expand a few steps — especially Wait for mock and Smoke request against mock. Confirm they
curlhttp://localhost:4500/health(or your mock port) and complete successfully. That output is your proof the pipeline talked to the coded mock, not the Express app.
That's enough for this module. LiftOff checks your public fork for both artifacts on a feature/ branch — the coded mock under postman/mocks/ and the CI workflow that runs postman mock run.
Troubleshooting
postman/mocks/missing fromgit status— create the mock in Local View (Part 2), not Cloud View, and confirm the folder is connected.- Workflow missing — add
.github/workflows/deskly-mock-ci.ymlor.github/workflows/deskly-mock-ci.yamlwithpostman mock runpointed at a.jsfile. - No run in Actions — enable Actions on the fork if prompted; confirm the branch name matches
feature/**in the workflowon.push.branchesfilter. - Push rejected — run
git pull --rebase origin <your-branch>and push again. - Validation can't see the repo — the fork must stay public (private repos return 404 to unauthenticated reads).