Skip to content

Commit

Permalink
Merge pull request #119 from docusign/add-actions
Browse files Browse the repository at this point in the history
Added the GitHub actions for the CLM and Notary collections
  • Loading branch information
asif-docusign authored Nov 4, 2024
2 parents aa6e5e2 + 4bb4e92 commit 6245833
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/sync-clm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Sync CLM Postman Collection

on:
push:
branches:
- master # Change this to the branch you want to trigger the action
paths:
- 'assets/clm-collection.json'

jobs:
update-postman:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Update CLM Postman Collection
env:
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
run: |
# Run the Postman API to update the collection
GITHUB_COLLECTION_PATH="./assets/clm-collection.json"
COLLECTION_UID=${{ vars.CLM_COLLECTION_UID }}
# Read the file content and wrap it inside a collection object
WRAPPED_CONTENT=$(jq -n --argfile data "$GITHUB_COLLECTION_PATH" '{"collection": $data}')
# Write the wrapped content to a temporary file
echo "$WRAPPED_CONTENT" > wrapped_collection.json
# Use curl with --data-binary to handle large file content
curl --location --request PUT "https://api.getpostman.com/collections/$COLLECTION_UID" \
--header "x-api-key: $POSTMAN_API_KEY" \
--header "Content-Type: application/json" \
--data-binary @wrapped_collection.json
37 changes: 37 additions & 0 deletions .github/workflows/sync-notary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Sync Notary Postman Collection

on:
push:
branches:
- master # Change this to the branch you want to trigger the action
paths:
- 'assets/notary-collection.json'

jobs:
update-postman:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Update Notary Postman Collection
env:
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
run: |
# Run the Postman API to update the collection
GITHUB_COLLECTION_PATH="./assets/notary-collection.json"
COLLECTION_UID=${{ vars.NOTARY_COLLECTION_UID }}
# Read the file content and wrap it inside a collection object
WRAPPED_CONTENT=$(jq -n --argfile data "$GITHUB_COLLECTION_PATH" '{"collection": $data}')
# Write the wrapped content to a temporary file
echo "$WRAPPED_CONTENT" > wrapped_collection.json
# Use curl with --data-binary to handle large file content
curl --location --request PUT "https://api.getpostman.com/collections/$COLLECTION_UID" \
--header "x-api-key: $POSTMAN_API_KEY" \
--header "Content-Type: application/json" \
--data-binary @wrapped_collection.json

0 comments on commit 6245833

Please sign in to comment.