-
Notifications
You must be signed in to change notification settings - Fork 16
68 lines (64 loc) · 2.72 KB
/
update-postman-collection.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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 }}