postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.84k stars 839 forks source link

Add workflow_dispatch for Github Actions CLI command preview template - v10 #11320

Open Chand-MD opened 2 years ago

Chand-MD commented 2 years ago

Is there an existing request for this feature?

Is your feature request related to a problem?

While copying the Postman CLI command overview for Github Actions can we add "workflow_dispatch" to the Build configuration template? This helps the users to run this workflow manually from the Actions tab.

Describe the solution you'd like

Add "workflow_dispatch" to the Github Actions Build configuration template

Describe alternatives you've considered

No response

Additional context

No response

malvikach commented 2 years ago

@ChandMohammadS thanks for the feedback and for setting up the discussion with us. Looking forward to understand this further during our call.

DannyDainton commented 2 years ago

I like the idea of extending the template and we can maybe even pass in some of the different arguments that are available like iterations for example:

name: Automated API tests using Postman CLI

on:
  workflow_dispatch:
    inputs:
      iterations:
        description: 'Number of iterations to run'
        required: false
        type: string

jobs:
  automated-api-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Postman CLI
        run: |
          curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh
      - name: Login to Postman CLI
        run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
      - name: Run API tests
        run: |
          postman collection run "CollectionUUID" -e "EnvironmentUUID" -n ${{ inputs.iterations || 1 }}
Chand-MD commented 2 years ago

This addition will be amazing for this feature #11320