Update Postman Collection #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Postman Collection | |
on: | |
schedule: | |
- cron: '0 17 * * FRI' | |
workflow_dispatch: | |
repository_dispatch: | |
types: [update_sdk] | |
jobs: | |
update-openapi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Download OpenAPI file | |
run: curl -sSL -o ./specs/openapi.yaml https://insulator.conductor.one/api/v1/openapi.yaml | |
- name: Install openapi-to-postmanv2 | |
run: npm install -g openapi-to-postmanv2 | |
- name: Generate Postman collection | |
run: make generate | |
- name: Check for changes | |
id: git_diff | |
run: | | |
git diff | |
if [[ -n $(git diff --name-only) ]]; then | |
echo "::set-output name=has_changes::true" | |
fi | |
- name: Create Pull Request if changed | |
if: steps.git_diff.outputs.has_changes == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'Update postman collection' | |
title: 'Update Postman collection' | |
body: 'This PR updates the regenerates the postman with the latest openapi.yaml' | |
branch: 'update-postman' |