Skip to content

Generate And Push Postman Collections #64

Generate And Push Postman Collections

Generate And Push Postman Collections #64

name: Generate And Push Postman Collections
on:
push:
branches:
- main
paths:
- 'api-specifications/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Postman dependencies
run: npm i -g openapi-to-postmanv2
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Push Postman collections
run: python ./scripts/push_postman_collection.py
env:
POSTMAN_MANAGEMENT: ${{ secrets.POSTMAN_MANAGEMENT }}
POSTMAN_WORKSPACE_ID: ${{ secrets.POSTMAN_WORKSPACE_ID }}
POSTMAN_PREPROD_WORKSPACE_ID: ${{ secrets.POSTMAN_PREPROD_WORKSPACE_ID }}
IS_PROD: 1
shell: bash
- name: Send success notification
if: ${{ success() }}
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
status: "${{ job.status }}"
channel: "C02J0CWR789"
username: "sdk-generation-bot"
text: "Postman Artefact publishing success, see the <https://www.postman.com/realcriteo|collections>."
icon_emoji: ":green_check:"
- name: Send failure notification
# if: ${{ failure() }}
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
status: "${{ job.status }}"
channel: "C02J0CWR789"
username: "sdk-generation-bot"
text: "Postman Artefact publishing failure, see the "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow run>" "
icon_emoji: ":x:"