bundled-skills/newman-cicd-integration/SKILL.md
Generate ready-to-use CI/CD pipeline configurations that install and run Newman for automated API testing. Use this skill whenever the user wants to run Newman in a CI pipeline, integrate Postman collections into automated builds, set up API tests in GitHub Actions, GitLab CI, Jenkins,...
npx skillsauth add FrancoStino/opencode-skills-antigravity newman-cicd-integrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when you need generate ready-to-use CI/CD pipeline configurations that install and run Newman for automated API testing. Use this skill whenever the user wants to run Newman in a CI pipeline, integrate Postman collections into automated builds, set up API tests in GitHub Actions, GitLab CI, Jenkins,...
Generate complete, copy-paste-ready CI/CD pipeline configs that install Newman and run Postman collections as part of automated builds.
Before generating a config, determine:
name: API Tests
on:
push:
branches: [main, develop]
pull_request:
jobs:
api-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Newman
run: |
npm install -g newman
npm install -g newman-reporter-htmlextra
- name: Run API tests
run: |
newman run ./collections/my-api.json \
-e ./environments/staging.json \
-r cli,junit,htmlextra \
--reporter-junit-export ./results/junit.xml \
--reporter-htmlextra-export ./results/report.html \
--reporter-htmlextra-title "API Test Results"
env:
BASE_URL: ${{ secrets.BASE_URL }}
API_KEY: ${{ secrets.API_KEY }}
- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Newman API Tests
path: results/junit.xml
reporter: java-junit
- name: Upload HTML report
uses: actions/upload-artifact@v4
if: always()
with:
name: api-test-report
path: results/report.html
stages:
- test
api-tests:
stage: test
image: node:18-alpine
before_script:
- npm install -g newman newman-reporter-htmlextra
script:
- |
newman run ./collections/my-api.json \
-e ./environments/staging.json \
--env-var "BASE_URL=$BASE_URL" \
--env-var "API_KEY=$API_KEY" \
-r cli,junit,htmlextra \
--reporter-junit-export results/junit.xml \
--reporter-htmlextra-export results/report.html
artifacts:
when: always
reports:
junit: results/junit.xml
paths:
- results/report.html
expire_in: 7 days
variables:
BASE_URL: $BASE_URL # Set in GitLab CI/CD > Variables
API_KEY: $API_KEY
pipeline {
agent any
tools {
nodejs 'NodeJS-18' // Configure in Global Tool Configuration
}
stages {
stage('Install Newman') {
steps {
sh 'npm install -g newman newman-reporter-htmlextra'
}
}
stage('Run API Tests') {
steps {
sh '''
newman run ./collections/my-api.json \
-e ./environments/staging.json \
-r cli,junit,htmlextra \
--reporter-junit-export results/junit.xml \
--reporter-htmlextra-export results/report.html \
--reporter-htmlextra-title "API Tests - ${BUILD_NUMBER}"
'''
}
}
}
post {
always {
junit 'results/junit.xml'
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'results',
reportFiles: 'report.html',
reportName: 'Newman API Test Report'
])
}
}
}
trigger:
branches:
include:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'Set up Node.js'
- script: |
npm install -g newman newman-reporter-htmlextra
displayName: 'Install Newman'
- script: |
newman run ./collections/my-api.json \
-e ./environments/staging.json \
--env-var "API_KEY=$(API_KEY)" \
-r cli,junit,htmlextra \
--reporter-junit-export $(System.DefaultWorkingDirectory)/results/junit.xml \
--reporter-htmlextra-export $(System.DefaultWorkingDirectory)/results/report.html
displayName: 'Run API Tests'
env:
API_KEY: $(API_KEY) # Set in Pipeline > Variables
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'results/junit.xml'
testRunTitle: 'Newman API Tests'
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: 'results/report.html'
ArtifactName: 'api-test-report'
version: 2.1
jobs:
api-tests:
docker:
- image: cimg/node:18.0
steps:
- checkout
- run:
name: Install Newman
command: npm install -g newman newman-reporter-htmlextra
- run:
name: Run API Tests
command: |
mkdir -p results
newman run ./collections/my-api.json \
-e ./environments/staging.json \
--env-var "API_KEY=$API_KEY" \
-r cli,junit,htmlextra \
--reporter-junit-export results/junit.xml \
--reporter-htmlextra-export results/report.html
- store_test_results:
path: results
- store_artifacts:
path: results/report.html
workflows:
test:
jobs:
- api-tests
Always inject sensitive values as CI environment variables/secrets:
Settings > Secrets and Variables > ActionsSettings > CI/CD > VariablesManage Jenkins > CredentialsPipelines > VariablesReference in Newman via --env-var "KEY=$SECRET_NAME" or pre-set in the environment file.
/
├── collections/
│ └── my-api.json
├── environments/
│ ├── staging.json
│ └── prod.json
└── results/ ← gitignored, created by Newman
Add results/ to .gitignore.
if: always() / when: alwaysEnsure test result artifacts are published even when Newman exits with a failure code.
Newman exits with code 1 if any tests fail — this automatically fails the pipeline step. Use --bail if you want to stop on the first failure rather than running all tests.
Once the Newman CICD output is delivered, ask the user:
"Would you like me to generate Postman Test Cases for these commands? (yes/no)"
If the user says yes:
If the user says no:
data-ai
Snapshot a site's SEO state and detect ranking, indexation, metadata, canonical, robots, schema, and on-page regressions over time.
development
Coordinate focused subagents on substantial work, keep their ownership non-overlapping, and integrate verified results. Use for large-scope Codex tasks; keep trivial work with the coordinator.
data-ai
Use when an owner asks to find a cofounder or project partner. Assess only that agent's own owner and rank only approved profiles other agents posted for their own owners.
devops
Install, configure, verify, repair, update, and uninstall Hyprland on Fedora Linux with GPU-aware detection (NVIDIA/AMD/Intel).