From 5ffb6e5be95d283e96eb28faa33e7f74f1276c34 Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 09:28:44 +0000 Subject: [PATCH 1/9] NPA-6014: debugging step --- .github/workflows/push-collection-to-postman.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index 0330251e..f1896bbd 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -35,6 +35,9 @@ jobs: else echo 'collection_id=${{ secrets.POSTMAN_INTEGRATION_COLLECTION_ID }}' >> $GITHUB_OUTPUT fi + - name: Check collection ID + id: check_collection_id + run: echo ${{ steps.get_collection_id.outputs.collectionId }} - name: push-to-postman-action id: process uses: gcatanese/push-to-postman-action@main From aa5d477b1bd170276555619be6536110400d132d Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 09:44:22 +0000 Subject: [PATCH 2/9] NPA-6014: Fix naming --- .github/workflows/push-collection-to-postman.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index f1896bbd..fc8f8102 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -37,7 +37,7 @@ jobs: fi - name: Check collection ID id: check_collection_id - run: echo ${{ steps.get_collection_id.outputs.collectionId }} + run: echo ${{ steps.get_collection_id.outputs.collection_id }} - name: push-to-postman-action id: process uses: gcatanese/push-to-postman-action@main @@ -45,4 +45,4 @@ jobs: goal: update postman-key: ${{ secrets.POSTMAN_API_KEY }} postman-file: '/postman/validated_relationship_service.${{ github.event.inputs.collection }}.postman_collection.json' - collection-id: ${{ steps.get_collection_id.outputs.collectionId }} + collection-id: ${{ steps.get_collection_id.outputs.collection_id }} From 88c31268dbf7520263975042f6bb10cb8f786792 Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 09:50:32 +0000 Subject: [PATCH 3/9] NPA-6014: Corrected filepath --- .github/workflows/push-collection-to-postman.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index fc8f8102..382251bb 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -44,5 +44,5 @@ jobs: with: goal: update postman-key: ${{ secrets.POSTMAN_API_KEY }} - postman-file: '/postman/validated_relationship_service.${{ github.event.inputs.collection }}.postman_collection.json' + postman-file: './postman/validated_relationship_service.${{ github.event.inputs.collection }}.postman_collection.json' collection-id: ${{ steps.get_collection_id.outputs.collection_id }} From db0b273b49831dd71f9280b14dccf6533707aa7f Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 09:57:11 +0000 Subject: [PATCH 4/9] NPA-6014: Removed unused varibles --- ...ed_relationship_service.sandbox.postman_collection.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/postman/validated_relationship_service.sandbox.postman_collection.json b/postman/validated_relationship_service.sandbox.postman_collection.json index 00116c35..a45bb35b 100644 --- a/postman/validated_relationship_service.sandbox.postman_collection.json +++ b/postman/validated_relationship_service.sandbox.postman_collection.json @@ -11052,11 +11052,6 @@ { "key": "api_base_url", "value": "https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4" - }, - { - "value": "", - "type": "string", - "disabled": true } ] -} \ No newline at end of file +} From a7740be2d7cd391af64ce2790ac58fb45d27938a Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 10:17:15 +0000 Subject: [PATCH 5/9] NPA-6224: Removed debugging steps --- .github/workflows/push-collection-to-postman.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index 382251bb..1913aa50 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -35,9 +35,6 @@ jobs: else echo 'collection_id=${{ secrets.POSTMAN_INTEGRATION_COLLECTION_ID }}' >> $GITHUB_OUTPUT fi - - name: Check collection ID - id: check_collection_id - run: echo ${{ steps.get_collection_id.outputs.collection_id }} - name: push-to-postman-action id: process uses: gcatanese/push-to-postman-action@main From f8076aae08a3486f34dde4d52299c3c191d47cf1 Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 11:12:54 +0000 Subject: [PATCH 6/9] NPA-6224: Improved workflow triggers --- .../workflows/push-collection-to-postman.yml | 98 +++++++++++++------ 1 file changed, 69 insertions(+), 29 deletions(-) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index 1913aa50..ff9aedb7 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -2,44 +2,84 @@ name: Push collection to Postman workspace on: workflow_dispatch: inputs: - collection: - type: choice - description: Collection to push - options: - - sandbox - - integration - required: true - default: sandbox - - workflow_call: - inputs: - collection: - type: string - description: Collection to push - required: true + should_push_sandbox: + type: boolean + description: Push Sandbox collection + default: false + should_push_integration: + type: boolean + description: Push Integration collection + default: false + push: + branches: + - master + paths: + - './postman/validated_relationship_service.**' jobs: - push-to-postman: - name: Push collection to Postman + detect-changes: + name: Detect which Postman collection has changed + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' }} + outputs: + sandbox: ${{ steps.filter.outputs.backend }} + integration: ${{ steps.filter.outputs.integration }} + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sandbox: + - './postman/validated_relationship_service.sandbox.postman_collection.json' + integration: + - './postman/validated_relationship_service.integration.postman_collection.json' + + push-sandbox-postman: + name: Push Sandbox collection to Postman runs-on: ubuntu-latest + needs: detect-changes + if: | + always () && ( + github.event_name == 'push' && needs.detect-changes.outputs.sandbox == 'true' || + github.event_name == 'workflow-dispatch' && github.event.inputs.should_push_sandbox == 'true' + ) steps: - name: Checkout uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Get collection ID - id: get_collection_id - run: | - if [[ '${{ github.event.inputs.collection }}' == 'sandbox' ]]; then - echo 'collection_id=${{ secrets.POSTMAN_SANDBOX_COLLECTION_ID }}' >> $GITHUB_OUTPUT - else - echo 'collection_id=${{ secrets.POSTMAN_INTEGRATION_COLLECTION_ID }}' >> $GITHUB_OUTPUT - fi - - name: push-to-postman-action - id: process + - name: Push Sandbox Postman collection + id: push_sandbox_postman_collection uses: gcatanese/push-to-postman-action@main with: goal: update postman-key: ${{ secrets.POSTMAN_API_KEY }} - postman-file: './postman/validated_relationship_service.${{ github.event.inputs.collection }}.postman_collection.json' - collection-id: ${{ steps.get_collection_id.outputs.collection_id }} + postman-file: './postman/validated_relationship_service.sandbox.postman_collection.json' + collection-id: ${{ secrets.POSTMAN_SANDBOX_COLLECTION_ID }} + + push-integration-postman: + name: Push Integration collection to Postman + runs-on: ubuntu-latest + needs: detect-changes + if: | + always () && ( + github.event_name == 'push' && needs.detect-changes.outputs.integration == 'true' || + github.event_name == 'workflow-dispatch' && github.event.inputs.should_push_integration == 'true' + ) + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Push Integration Postman collection + id: push_integration_postman_collection + uses: gcatanese/push-to-postman-action@main + with: + goal: update + postman-key: ${{ secrets.POSTMAN_API_KEY }} + postman-file: './postman/validated_relationship_service.integration.postman_collection.json' + collection-id: ${{ secrets.POSTMAN_INTEGRATION_COLLECTION_ID }} From 78c4a864b2d86295b503a7ef057606b74f50b059 Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 11:18:02 +0000 Subject: [PATCH 7/9] NPA-6224: Corrected inputs and conditions --- .github/workflows/push-collection-to-postman.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index ff9aedb7..ccea9967 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name == 'push' }} outputs: - sandbox: ${{ steps.filter.outputs.backend }} + sandbox: ${{ steps.filter.outputs.sandbox }} integration: ${{ steps.filter.outputs.integration }} steps: - name: Checkout @@ -41,11 +41,11 @@ jobs: push-sandbox-postman: name: Push Sandbox collection to Postman runs-on: ubuntu-latest - needs: detect-changes + needs: [detect-changes] if: | always () && ( - github.event_name == 'push' && needs.detect-changes.outputs.sandbox == 'true' || - github.event_name == 'workflow-dispatch' && github.event.inputs.should_push_sandbox == 'true' + (github.event_name == 'push' && needs.detect-changes.outputs.sandbox == 'true') || + (github.event_name == 'workflow_dispatch' && github.event.inputs.should_push_sandbox == 'true') ) steps: - name: Checkout @@ -64,11 +64,11 @@ jobs: push-integration-postman: name: Push Integration collection to Postman runs-on: ubuntu-latest - needs: detect-changes + needs: [detect-changes] if: | always () && ( - github.event_name == 'push' && needs.detect-changes.outputs.integration == 'true' || - github.event_name == 'workflow-dispatch' && github.event.inputs.should_push_integration == 'true' + (github.event_name == 'push' && needs.detect-changes.outputs.integration == 'true') || + (github.event_name == 'workflow_dispatch' && github.event.inputs.should_push_integration == 'true') ) steps: - name: Checkout From 7626579085387f228607c042d8b198e74257248f Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 11:20:27 +0000 Subject: [PATCH 8/9] NPA-6224: Updated name --- .github/workflows/push-collection-to-postman.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index ccea9967..0cecf2ec 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -1,4 +1,4 @@ -name: Push collection to Postman workspace +name: Push Postman collection changes to public collection on: workflow_dispatch: inputs: From 52b4da41979d87b8320a58791abca35cc2846c72 Mon Sep 17 00:00:00 2001 From: adamclarkson Date: Thu, 8 Jan 2026 11:24:16 +0000 Subject: [PATCH 9/9] NPA-6224: Added description to workflow --- .github/workflows/push-collection-to-postman.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/push-collection-to-postman.yml b/.github/workflows/push-collection-to-postman.yml index 0cecf2ec..36d9039d 100644 --- a/.github/workflows/push-collection-to-postman.yml +++ b/.github/workflows/push-collection-to-postman.yml @@ -1,4 +1,9 @@ name: Push Postman collection changes to public collection +# This workflow pushes any changes to the Postman collections in the repo to the Postman collections within the +# Validated Relationships Service workspace. +# This means that all changes and version control are handled within GitHub for the collections and only once the +# changes have been merged are the public-facing Postman collections updated. +# Please see updated instructions on Confluence for further details about how this workflow fits into that process. on: workflow_dispatch: inputs: