@@ -64,24 +64,29 @@ jobs:
64
64
python-version : " 3.12"
65
65
- name : Install doc generation dependencies
66
66
run : |
67
+ set -euo pipefail
67
68
pip install --require-hashes -r docs/requirements.txt
68
69
- name : Git refresh tip (detached mode)
69
70
# Git Detached mode (release notes) doesn't have origin
70
71
if : ${{ inputs.detached_mode }}
71
72
run : |
73
+ set -euo pipefail
72
74
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"
74
76
git pull origin "$BRANCH"
75
77
env :
76
78
BRANCH : ${{ inputs.git_ref }}
77
79
- name : Normalize Version Number
78
80
env :
79
81
VERSION : ${{ inputs.version }}
80
- run : echo "VERSION=$(echo $VERSION | sed 's/v//')" >> $GITHUB_ENV
82
+ run : |
83
+ set -euo pipefail
84
+ echo "VERSION=$(echo "$VERSION" | sed 's/v//')" >> "$GITHUB_ENV"
81
85
- name : Build docs website and API reference
82
86
env :
83
87
ALIAS : ${{ inputs.alias }}
84
88
run : |
89
+ set -euo pipefail
85
90
rm -rf site
86
91
mkdocs build
87
92
- name : Configure AWS credentials
@@ -101,18 +106,20 @@ jobs:
101
106
ALIAS : ${{ inputs.alias }}
102
107
AWS_DOCS_BUCKET : ${{ secrets.AWS_DOCS_BUCKET }}
103
108
run : |
109
+ set -euo pipefail
104
110
aws s3 sync \
105
111
site/ \
106
- s3://$AWS_DOCS_BUCKET/lambda-typescript/$VERSION/
112
+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/$VERSION/"
107
113
- name : Deploy Docs (Alias)
108
114
env :
109
115
VERSION : ${{ inputs.version }}
110
116
ALIAS : ${{ inputs.alias }}
111
117
AWS_DOCS_BUCKET : ${{ secrets.AWS_DOCS_BUCKET }}
112
118
run : |
119
+ set -euo pipefail
113
120
aws s3 sync \
114
121
site/ \
115
- s3://$AWS_DOCS_BUCKET/lambda-typescript/$ALIAS/
122
+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/$ALIAS/"
116
123
- name : Deploy Docs (Version JSON)
117
124
env :
118
125
VERSION : ${{ inputs.version }}
@@ -131,11 +138,12 @@ jobs:
131
138
# - if it's a new version number, we add it at position 0 in the array.
132
139
# 4. Once done, we'll upload it back to S3.
133
140
run : |
141
+ set -euo pipefail
134
142
aws s3 cp \
135
- s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json \
143
+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json" \
136
144
versions_old.json
137
- jq 'del(.[].aliases[] | select(. == " $ALIAS" ))' < versions_old.json > versions_proc.json
138
- jq '. 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
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
139
147
aws s3 cp \
140
148
versions.json \
141
- s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json
149
+ " s3://$AWS_DOCS_BUCKET/lambda-typescript/versions.json"
0 commit comments