Skip to content

Commit 503d602

Browse files
CLOUDP-293820: Update optional validations workflow to use cached npm (#345)
1 parent 0f24ab6 commit 503d602

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/optional-spec-validations.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ jobs:
2626
steps:
2727
- name: Checkout repository
2828
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
29+
- name: Setup Node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20.x'
33+
cache: 'npm'
34+
- name: Install npm dependencies
35+
run: npm install
2936
- name: Download openapi-foas
3037
uses: actions/download-artifact@v4
3138
with:

tools/postman/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ The OpenAPI path for Postman generation and configured feature flags can also be
8383

8484
### Running locally
8585

86-
Once env vars are configured, the setup scripts can be run locally using the Make following commands:
86+
Once env vars are configured, install the required dependencies:
87+
88+
```
89+
npm install
90+
```
91+
92+
Then, the setup scripts can be run locally using the Make following commands:
8793
- `make fetch_openapi`
8894
- `make convert_to_collection` - covert OpenAPI to Postman collection
8995
- `make transform_collection` - transform Postman collection to fix common issues

tools/postman/scripts/convert-to-collection.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ TMP_FOLDER=${TMP_FOLDER:-"../tmp"}
1818
echo "Removing regex"
1919
jq 'del(.. | select(type == "object") | .pattern?)' "$OPENAPI_FOLDER"/"$OPENAPI_FILE_NAME" > "$TMP_FOLDER"/tmp.json
2020

21-
echo "Installing openapi-to-postmanv2"
22-
npm install
23-
2421
echo "Converting $OPENAPI_FOLDER/$OPENAPI_FILE_NAME from OpenAPI to PostmanV2"
2522
npx openapi2postmanv2 -s "$TMP_FOLDER"/tmp.json -o "$TMP_FOLDER"/"$COLLECTION_FILE_NAME" -O folderStrategy=Tags
2623

0 commit comments

Comments
 (0)