From 4e6f662b244a941a911c1ed5973bef11d7610093 Mon Sep 17 00:00:00 2001 From: Simon Thulbourn Date: Thu, 17 Aug 2023 17:29:25 +0200 Subject: [PATCH] fix(docs): update versions.json jq query --- .github/workflows/reusable-publish-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-publish-docs.yml b/.github/workflows/reusable-publish-docs.yml index d70d25d526..499221aa99 100644 --- a/.github/workflows/reusable-publish-docs.yml +++ b/.github/workflows/reusable-publish-docs.yml @@ -130,7 +130,7 @@ jobs: s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json \ versions_old.json jq 'del(.[].aliases[] | select(. == "${{ env.ALIAS }}"))' < versions_old.json > versions_proc.json - jq '. as $o | [{"title": "${{ env.VERSION }}", "version": "${{ env.VERSION }}", "aliases": ["${{env.ALIAS}}"] }] as $n | $n | if .[0].title | test("[a-z]+") or any($o[].title == "${{ env.VERSION }}";.) then $o else $n + $o end' < versions_proc.json > versions.json + jq '. as $o | [{"title": "${{ env.VERSION }}", "version": "${{ env.VERSION }}", "aliases": ["${{ env.ALIAS }}"] }] as $n | $n | if .[0].title | test("[a-z]+") or any($o[].title == $n[0].title;.) then [($o | .[] | select(.title == $n[0].title).aliases += $n[0].aliases | . )] else $n + $o end' < versions_proc.json > versions.json aws s3 cp \ versions.json \ s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json