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 Kamble, reviewed by Priyanka G.
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.
Frequently asked questions
1.Newman exit codes?
2.Can Newman run pre-request scripts?
3.How do I attach the report to PR comments?
4.Is Newman replaced by Postman CLI?
Practice these questions
Rehearse REST, Postman, REST Assured and contract-testing questions with worked examples.
Was this article helpful?
More from REST API Testing
REST fundamentals — verbs, status codes, contracts.
- Experience-Level QA InterviewsAPI Testing Interview Questions for 1 Year Experience (2026 Complete Guide)
- Experience-Level QA InterviewsAPI Testing Interview Questions for 3 Years Experience (2026 Complete Guide)
- Experience-Level QA InterviewsAPI Testing Interview Questions for Senior Level (2026 Complete Guide)
Keep building your QA edge
Pillar guides- Postman TutorialSoftwareTestPilot's Postman walkthroughPostman from zero to CI — collections, scripts, Newman.
- cURL to Code ConverterSoftwareTestPilot's free cURL converterConvert any cURL command to Postman, Playwright, Rest Assured, k6, Cypress, Python, and more — free, in-browser.
- JSON / JSONPath / JMESPath Testerbuild API assertions in the browserDual-engine JSONPath + JMESPath tester with assertion builder and Postman/Playwright/Rest Assured export.
- Postman to Code ConverterPostman collection to code converterConvert any Postman collection into a full Playwright, Rest Assured, k6, Cypress, Supertest, Python, or Karate test suite — folders, pm.test assertions, and environments preserved.
- Cron Expression Builder & Testerbuild and test cron for Jenkins and GitHub ActionsVisual cron builder with next-10 run times, timezone picker, and one-click export to Jenkins, GitHub Actions, Kubernetes CronJob, Quartz, Node-cron, and pg_cron.
- API Tester RoleAPI Tester career path and salaryAPI Tester career guide — Postman, REST Assured, contract testing, and pay.
Practice these questions live
Rehearse with an AI QA interviewer that scores your answers in real time.
Continue reading
Related concepts, tools & standards around API Testing
A quick reference of the people, companies, frameworks and technologies most often mentioned alongside API Testing in real QA teams — useful when you're mapping a learning path, preparing for interviews, or scoping a new project.
Join the QA Community
Connect with fellow testers, share job leads, and get career advice.
Stop Reinventing the Wheel. Upgrade Your QA Arsenal.
Take your testing skills from beginner to Lead Engineer. Supercharge your daily workflow with our premium digital resources.
- Ready-to-use testing strategy templates
- Advanced API & UI automation guides
- ⏱️ Save 10+ hours a week on test planning



Discussion
Ask a question, share your experience, or correct us. Be kind — real people are reading.