Postman Newman CLI — CI/CD Guide with GitHub Actions (2026)
Run Postman collections in CI with Newman: exit codes, HTML reports, environment secrets, parallel execution, and a copy-paste GitHub Actions workflow that fails builds on API regressions.

Last updated 2026-07-20 · 10 min read · By Avinash K
Newman is the missing piece between a Postman collection and a passing CI build. This guide covers install, HTML reporting, secret injection, parallel runs, and a copy-paste GitHub Actions workflow that turns any collection into a merge-blocking check in under 15 minutes.
Key takeaways
- Install Newman + reporters in one command.
- Secret injection without leaking to logs.
- HTML + JUnit reports for PR comments.
- A production-ready GitHub Actions workflow.
1. Install Newman + reporters
npm install -g newman newman-reporter-htmlextra
newman run collection.json \
-e env.json \
-r cli,htmlextra,junit \
--reporter-junit-export report.xml2. Secret injection
newman run collection.json \
--env-var "API_TOKEN=$API_TOKEN" \
--env-var "BASE_URL=$BASE_URL"Never commit env.json with secrets — always use --env-var from CI environment variables.
3. GitHub Actions workflow
name: API Regression
on: [pull_request]
jobs:
newman:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npm install -g newman newman-reporter-htmlextra
- name: Run collection
env:
API_TOKEN: ${{ secrets.API_TOKEN }}
run: |
newman run collection.json \
--env-var "API_TOKEN=$API_TOKEN" \
-r cli,htmlextra,junit \
--reporter-htmlextra-export report.html \
--reporter-junit-export report.xml
- uses: actions/upload-artifact@v4
if: always()
with:
name: newman-report
path: report.html
- uses: dorny/test-reporter@v1
if: always()
with:
name: Newman
path: report.xml
reporter: java-junit4. Parallel execution
Newman does not fork by default. Split collections by folder and run them in a matrix job, or use newman-run-parallel for local parallelism. For long-running suites, convert to REST Assured or export to Playwright — both parallelise natively.
Newman collections scale poorly when every service owns its own suite. Read our microservices testing strategy before you standardise collections across teams, and shift-left testing in DevOps for where to run them in the pipeline.