Skip to content

Merge pull request #462 from freee/feature/update_schema_files_2024-1… #13

Merge pull request #462 from freee/feature/update_schema_files_2024-1…

Merge pull request #462 from freee/feature/update_schema_files_2024-1… #13

name: update-postman-collection
on:
push:
branches:
- master
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-nodemodule
- name: set up tool
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm install [email protected] && npm install [email protected]
update-accounting-postman-collection:
runs-on: ubuntu-latest
needs: setup
env:
product: accounting
download-url: https://raw.githubusercontent.com/freee/freee-api-schema/master/v2020_06_15/open-api-3/api-schema.json
collection-id: 77985c23-b135-4b1b-898f-7f4890e2bb0b
postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: restore node_modules
id: node_modules_cache_id
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-nodemodule
- name: download schema
run: curl -o tmp/${{ env.product }}/oas.json --create-dirs ${{ env.download-url }}
- name: remove urlencoded
run: bash ./script/remove_urlencoded.sh
- name: generate collection
run: node_modules/.bin/openapi2postmanv2 -s tmp/${{ env.product }}/oas.json -o tmp/${{ env.product }}/collection.json -p -O folderStrategy=Tags,parametersResolution=Example,stackLimit=50,enableOptionalParameters=false
- name: update collection
run: node script/update-postman-collection.js ${{ env.product }} ${{ env.collection-id }} ${{ env.postman-api-key }}
update-hr-postman-collection:
runs-on: ubuntu-latest
needs: setup
env:
product: hr
download-url: https://raw.githubusercontent.com/freee/freee-api-schema/master/hr/open-api-3/api-schema.json
collection-id: 7ba7d5ed-5cdd-4946-8922-cbee12187829
postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: restore node_modules
id: node_modules_cache_id
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-nodemodule
- name: download schema
run: curl -o tmp/${{ env.product }}/oas.json --create-dirs ${{ env.download-url }}
- name: generate collection
run: node_modules/.bin/openapi2postmanv2 -s tmp/${{ env.product }}/oas.json -o tmp/${{ env.product }}/collection.json -p -O folderStrategy=Tags,parametersResolution=Example,stackLimit=50,enableOptionalParameters=false
- name: update collection
run: node script/update-postman-collection.js ${{ env.product }} ${{ env.collection-id }} ${{ env.postman-api-key }}