🔘Azure DevOps Pipelines

How to add Pynt into a Azure Pipelines

Prerequisites

  • Python installed on the agent

Pipeline Configuration

  • Copy your Pynt ID into the pipeline variable and store it as a secret:

  • Add Pynt to your pipeline. See the following example of a job in an Azure pipeline that runs Pynt on our goat vulnerable application:

trigger:
- main

pool: 
  name: test

steps:
- script: python3 -m pip install --upgrade pyntcli
  displayName: 'Install pynt cli'

- script: curl https://raw.githubusercontent.com/pynt-io/pynt/main/goat_functional_tests/goat.postman_collection.json -o goat.json 
  displayName: 'Get goat collection'

- script: |
    export PYNT_ID = $(PYNT_ID)
    pynt newman --collection goat.json --reporters --return-error=errors-only
  displayName: 'Run pynt with newman integration '

Controlling the return code from Pynt

pynt newman and pynt command have an optional flag --return-error

With this flag, you have granular control over whether Pynt returns an error code (non zero) in the event of findings. Use this flag to control when Pynt will break the CI/CD run, allowed values are:

'all-findings' (warnings or errors),
'errors-only',
'never' (default)

Last updated