@@ -64,22 +64,29 @@ jobs:
6464 python-version : " 3.12"
6565 - name : Install doc generation dependencies
6666 run : |
67+ set -euo pipefail
6768 pip install --require-hashes -r docs/requirements.txt
6869 - name : Git refresh tip (detached mode)
6970 # Git Detached mode (release notes) doesn't have origin
7071 if : ${{ inputs.detached_mode }}
7172 run : |
73+ set -euo pipefail
7274 git config pull.rebase true
73- git config remote.origin.url >&- || git remote add origin https://github.com/" $ORIGIN"
75+ git config remote.origin.url >&- || git remote add origin " https://github.com/$ORIGIN"
7476 git pull origin "$BRANCH"
7577 env :
7678 BRANCH : ${{ inputs.git_ref }}
7779 - name : Normalize Version Number
78- run : echo "VERSION=$(echo ${{ inputs.version }} | sed 's/v//')" >> $GITHUB_ENV
80+ env :
81+ VERSION : ${{ inputs.version }}
82+ run : |
83+ set -euo pipefail
84+ echo "VERSION=$(echo "$VERSION" | sed 's/v//')" >> "$GITHUB_ENV"
7985 - name : Build docs website and API reference
8086 env :
8187 ALIAS : ${{ inputs.alias }}
8288 run : |
89+ set -euo pipefail
8390 rm -rf site
8491 mkdocs build
8592 - name : Configure AWS credentials
@@ -99,18 +106,20 @@ jobs:
99106 ALIAS : ${{ inputs.alias }}
100107 AWS_DOCS_BUCKET : ${{ secrets.AWS_DOCS_BUCKET }}
101108 run : |
109+ set -euo pipefail
102110 aws s3 sync \
103111 site/ \
104- s3://$AWS_DOCS_BUCKET/lambda-typescript/$VERSION/
112+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/$VERSION/"
105113 - name : Deploy Docs (Alias)
106114 env :
107115 VERSION : ${{ inputs.version }}
108116 ALIAS : ${{ inputs.alias }}
109117 AWS_DOCS_BUCKET : ${{ secrets.AWS_DOCS_BUCKET }}
110118 run : |
119+ set -euo pipefail
111120 aws s3 sync \
112121 site/ \
113- s3://$AWS_DOCS_BUCKET/lambda-typescript/$ALIAS/
122+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/$ALIAS/"
114123 - name : Deploy Docs (Version JSON)
115124 env :
116125 VERSION : ${{ inputs.version }}
@@ -129,11 +138,12 @@ jobs:
129138 # - if it's a new version number, we add it at position 0 in the array.
130139 # 4. Once done, we'll upload it back to S3.
131140 run : |
141+ set -euo pipefail
132142 aws s3 cp \
133- s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json \
143+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json" \
134144 versions_old.json
135- jq 'del(.[].aliases[] | select(. == "${{ env. ALIAS }}" ))' < versions_old.json > versions_proc.json
136- 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
145+ jq --arg ALIAS "$ALIAS" 'del(.[].aliases[] | select(. == $ ALIAS))' < versions_old.json > versions_proc.json
146+ jq --arg VERSION "$VERSION" --arg ALIAS "$ALIAS" '. as $o | [{"title": $ VERSION, "version": $ VERSION, "aliases": [$ 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
137147 aws s3 cp \
138148 versions.json \
139- s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json
149+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json"
0 commit comments