Skip to content

Commit

Permalink
Merge pull request #36 from matt-ball/compiled-latest
Browse files Browse the repository at this point in the history
compiled latest
  • Loading branch information
matt-ball authored Oct 8, 2021
2 parents 1519aa9 + ee229e6 commit c1b0ce8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 58 deletions.
57 changes: 1 addition & 56 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254210,49 +254210,10 @@ async function init () {
try {
const get = core.getInput
const required = { required: true }
const apiBase = 'https://api.postman.com'
const idRegex = /^[0-9]{7,}-\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/

const options = {
apiKey: '?apikey=' + get('apiKey'),
collection: get('collection', required),
environment: get('environment'),
globals: get('globals'),
iterationCount: Number(get('iterationCount')),
iterationData: get('iterationData'),
folder: split(get('folder')),
workingDir: get('workingDir'),
insecureFileRead: safeParse(get('insecureFileRead')),
timeout: Number(get('timeout')),
timeoutRequest: Number(get('timeoutRequest')),
timeoutScript: Number(get('timeoutScript')),
delayRequest: Number(get('delayRequest')),
ignoreRedirects: safeParse(get('ignoreRedirects')),
insecure: safeParse(get('insecure')),
bail: safeParse(get('bail')),
suppressExitCode: safeParse(get('suppressExitCode')),
reporters: split(get('reporters')),
reporter: safeParse(get('reporter')),
color: get('color'),
sslClientCert: get('sslClientCert'),
sslClientKey: get('sslClientKey'),
sslClientPassphrase: get('sslClientPassphrase'),
sslClientCertList: split(get('sslClientCertList')),
sslExtraCaCerts: get('sslExtraCaCerts'),
requestAgents: safeParse(get('requestAgents')),
cookieJar: get('cookieJar')
}

if (!options.apiKey) {
core.warning('No Postman API key provided.')
}

if (options.collection.match(idRegex)) {
options.collection = `${apiBase}/collections/${options.collection}${options.apiKey}`
}

if (options.environment.match(idRegex)) {
options.environment = `${apiBase}/environments/${options.environment}${options.apiKey}`
environment: get('environment')
}

runNewman(options)
Expand All @@ -254261,22 +254222,6 @@ async function init () {
}
}

function safeParse (obj) {
if (obj) {
try {
return JSON.parse(obj)
} catch (e) {
core.warning('Bad object passed in config!')
}
}

return null
}

function split (str) {
return str.split(',')
}

function runNewman (options) {
newman.run(options).on('done', (err, summary) => {
if (!options.suppressExitCode && (err || summary.run.failures.length)) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newman-action",
"version": "0.3.3",
"version": "0.3.4",
"description": "Run Postman collections with Newman as a GitHub Action",
"main": "dist/index.js",
"repository": {
Expand Down

0 comments on commit c1b0ce8

Please sign in to comment.