Giter Site home page Giter Site logo

bitwage / postman-collection-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jneate/postman-collection-action

0.0 0.0 0.0 598 KB

Use this GitHub Action to create/update Postman Collection(s) from a GitHub Repo into a specific Postman Workspace

License: MIT License

TypeScript 96.33% JavaScript 3.67%

postman-collection-action's Introduction

postman-collection-action status

Postman Collection Action

This GitHub action will scan the repository contents for any Postman Collection JSON files and create or update the Collection in a specific Postman Workspace, the check to determine whether to create a new collection or update an existing one is based on the Collection ID, this is the info._postman_id field in an exported v2.1 collection.

If the Postman API returns a different Collection ID then the action will update the file, if you wish to commit this back into the Git repository then you can combine this action with stefanzweifel/git-auto-commit-action@v4 which automatically commits the changed file(s). See the example usage sections below for more information.

Note: This action uses the \t character as formatting for the JSON document, the first commit might result in a large change due to this formatting character

The local search process finds any .json files, attempts to parse them as valid JSON objects and then checks the info.schema field to match https://schema.getpostman.com/json/collection/v2.1.0/collection.json.

The following 4 Postman APIs are currently used:

  • Get All Collections - GET - https://api.getpostman.com/collections
  • Create a New Collection - POST - https://api.getpostman.com/collections
  • Create a New Collection in a Workspace - POST - https://api.getpostman.com/collections?workspace={{workspace_id}}
  • Update A Collections - https://api.getpostman.com/collections/{{collection_uid}}

Inputs

postmanApiKey

Required This is the postman API key you have created that has access to your workspace.

If you don't have an API Key, you can follow the instructions here

It's recommended to store this value in a secret so it's not visible in any log output / file content

postmanWorkspaceId

Optional This is the ID of the Workspace the collection should be created/updated in. Default: My Workspace which is associated to your API Key.

postmanTimeout

Optional This is the number of milliseconds to wait for the Postman APIs to respond before timing out. Default: 15000

Example Usage

All Inputs

- name: Checkout
  uses: actions/checkout@v2

- name: Sync Postman Collections
  uses: jneate/postman-collection-action@v1
  with:
    postmanApiKey: ${{ secrets.postmanApiKey }}
    postmanWorkspaceId: 0f41daa6-c9a7-49d9-8455-707e2f46da22
    postmanTimeout: 30000

With Auto Git Commit

- name: Checkout
  uses: actions/checkout@v2

- name: Sync Postman Collections
  uses: jneate/postman-collection-action@v1
  with:
    postmanApiKey: ${{ secrets.postmanApiKey }}
    postmanWorkspaceId: 0f41daa6-c9a7-49d9-8455-707e2f46da22
    postmanTimeout: 30000

- name: Commit Updated Postman Collection IDs
  uses: stefanzweifel/git-auto-commit-action@v4
  with:
    commit_message: Updated Postman Collection ID

Required Only Inputs

- name: Checkout
  uses: actions/checkout@v2

- name: Sync Postman Collections
  uses: jneate/postman-collection-action@v1
  with:
    postmanApiKey: ${{ secrets.postmanApiKey }}

postman-collection-action's People

Contributors

dependabot[bot] avatar jneate avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.