Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/release-postman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Postman Release
on:
# Enabled by CLOUDP-262512
# schedule:
# - cron: '0 0 10 ? * *'
workflow_dispatch:

jobs:
release-postman:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and upload Collection
working-directory: ./tools/postman
env:
BASE_URL: ${{ secrets.BASE_URL }}
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
WORKSPACE_ID: ${{ secrets.WORKSPACE_ID }}
run: |
make build_and_upload
4 changes: 2 additions & 2 deletions tools/postman/scripts/transform-for-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ echo "Wrapping Collection in \"collection\" tag"
jq '{"collection": .}' "$COLLECTION_FILE_NAME" > intermediateCollectionWrapped.json

echo "Disabling query params by default"
jq '(.. | select(.request? != null).request.url.query.[].disabled) = true ' intermediateCollectionWrapped.json > intermediateCollectionDisableQueryParam.json
jq '(.. | select(.request? != null).request.url.query[].disabled) = true ' intermediateCollectionWrapped.json > intermediateCollectionDisableQueryParam.json

# This is to be removed because it is autogenerated when a new collection is created
echo "Removing _postman_id"
Expand All @@ -40,7 +40,7 @@ echo "Updating name with version"
jq '.collection.info.name = "MongoDB Atlas Administration API '"${current_api_revision}"'"' intermediateCollectionNoPostmanID.json > intermediateCollectionWithName.json

echo "Updating baseUrl"
jq '.collection.variable.[0].value = "'"${BASE_URL}"'"' intermediateCollectionWithName.json > intermediateCollectionWithBaseURL.json
jq '.collection.variable[0].value = "'"${BASE_URL}"'"' intermediateCollectionWithName.json > intermediateCollectionWithBaseURL.json

if [ "$USE_ENVIRONMENT_AUTH" = "false" ]; then
echo "Adding auth variables"
Expand Down
2 changes: 1 addition & 1 deletion tools/postman/scripts/upload-collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if [ "$collection_exists" = "false" ]; then
else
# Find collection ID and update collection
echo "Updating remote collection ${current_collection_name}"
collection_id=$(jq -r '.collections | map(select(.name=="'"${current_collection_name}"'").id).[0]' "${COLLECTIONS_LIST_FILE}")
collection_id=$(jq -r '.collections | map(select(.name=="'"${current_collection_name}"'").id)[0]' "${COLLECTIONS_LIST_FILE}")
curl --show-error --fail --retry 5 --retry-connrefused --silent --request PUT \
--location "https://api.getpostman.com/collections/${collection_id}" \
--header "Content-Type: application/json" \
Expand Down