diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a549a57 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @aegrey diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 849ae17..577d74a 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -12,7 +12,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GH_TOKEN }} - name: Build and push ghcr.io id: build-and-push diff --git a/.github/workflows/build-on-tag.yml b/.github/workflows/build-on-tag.yml index e700680..ef424ed 100644 --- a/.github/workflows/build-on-tag.yml +++ b/.github/workflows/build-on-tag.yml @@ -33,21 +33,7 @@ jobs: - name: Bundle run: yarn bundle -# - name: Publish to NPM -# env: -# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} -# run: npm publish - -# - name: Build docker image -# run: | -# echo '${{ secrets.DOCKERHUB_PASSWORD }}' | \ -# docker login \ -# --username ${{ secrets.DOCKERHUB_USERNAME }} \ -# --password-stdin -# export tag=${GITHUB_REF/refs\/tags\/v/} -# docker build . -t loadimpact/postman-to-k6:$tag -# docker tag \ -# loadimpact/postman-to-k6:$tag \ -# loadimpact/postman-to-k6:latest -# docker push loadimpact/postman-to-k6:$tag -# docker push loadimpact/postman-to-k6:latest + - name: Publish to NPM + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish diff --git a/CHANGELOG.md b/CHANGELOG.md index ef055dd..edc032c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/apideck-libraries/postman-to-k6/compare/v1.8.7...HEAD) +## [Unreleased](https://github.com/aegrey/postman-to-k6/compare/v1.8.7...HEAD) + +## [1.9.0] - 2024-03-26 + +### Added + +- Support for pm.response.headers.get() (#1) + +--- ## [1.8.10] - 2024-01-05 diff --git a/README.md b/README.md index 1614aa4..a1e1126 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,25 @@ -
+# POSTMAN TO k6 -![postman-to-k6-cover](./assets/postman-to-k6-cover.png) -
+This project is a friendly fork of [apideck-libraries/postman-to-k6](https://github.com/apideck-libraries/postman-to-k6) from the original [grafana/postman-to-k6](https://github.com/grafana/postman-to-k6), where I will focus on **building out new features not currently supported** alongside maintenance. -# Postman-to-k6 +#### Request a New Features +Open an issue with your feature request (must me something currently supported in postman) and I'll work on the requests with the most votes in order. + +Also feel free to contribute or pass any suggestions along! + + +--- Converts a [Postman collection](https://www.getpostman.com/docs/collections) to a [k6 script](https://docs.k6.io/docs). The postman-to-k6 converter utilizes your Postman collection and converts all the Postman requests, including tests, variables, ... to K6 scripts that can be executed by K6 to run performance tests. -![Github badge](https://github.com/apideck-libraries/postman-to-k6/actions/workflows/build-on-tag.yml/badge.svg) -![npm](https://img.shields.io/npm/v/@apideck/postman-to-k6.svg) -![npm](https://img.shields.io/npm/dw/@apideck/postman-to-k6.svg) +![Github badge](https://github.com/aegrey/postman-to-k6/actions/workflows/build-on-tag.yml/badge.svg) +![npm](https://img.shields.io/npm/v/@aegrey/postman-to-k6.svg) +![npm](https://img.shields.io/npm/dw/@aegrey/postman-to-k6.svg) -This project is a friendly fork of the original [grafana/postman-to-k6](https://github.com/grafana/postman-to-k6) -converter, actively maintained and open for new contributions. ## Content diff --git a/aegrey-changes.md b/aegrey-changes.md new file mode 100644 index 0000000..d612e74 --- /dev/null +++ b/aegrey-changes.md @@ -0,0 +1,8 @@ +# Changelog highlights - by aegrey + +## Support for Response Headers + +By adding support for the +Postman [Response Data](https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/#scripting-with-response-data) +has long been unsupported, despite it being a fairly straightforward change. v1.9.0 implements support for `pm.response.headers.get()` + diff --git a/changes-since-1.5.0-release.md b/apideck-changes.md similarity index 99% rename from changes-since-1.5.0-release.md rename to apideck-changes.md index f6f81ff..2026579 100644 --- a/changes-since-1.5.0-release.md +++ b/apideck-changes.md @@ -1,4 +1,4 @@ -# Changelog highlights +# Changelog highlights - by apideck-libraries As you might have noticed, the postman-to-k6 converter was rather inactive the last couple of months. With the help of the k6 team, the project will continue to be actively developed and maintained in a friendly fork => https://github.com/apideck-libraries/postman-to-k6. diff --git a/lib/shim/core.js b/lib/shim/core.js index 92d7438..7be1504 100644 --- a/lib/shim/core.js +++ b/lib/shim/core.js @@ -461,12 +461,15 @@ const pm = Object.freeze({ /* Response information */ response: Object.freeze({ + headers: Object.freeze({ + get(name) { + const header = store.response.headers.cased[name]; + return header ? header : null; + }, + }), get code() { return store.response.code; }, - get headers() { - throw new Error('pm.response.headers not supported'); - }, json() { parseBodyJson(); const body = store.response.body;