@@ -75,7 +75,8 @@ if [ "${DEBUG}" != "false" ]; then
7575fi
7676
7777echo " INFO: Generating release notes from github draft release"
78- release_notes_content=$( ${ROOTDIR} /.github/scripts/pull-release-notes.py ${ic_version} ${helm_chart_version} ${k8s_versions} " ${release_date} " )
78+ # shellcheck disable=SC2086
79+ release_notes_content=$( " ${ROOTDIR} " /.github/scripts/pull-release-notes.py " ${ic_version} " " ${helm_chart_version} " " ${k8s_versions} " " ${release_date} " )
7980if [ $? -ne 0 ]; then
8081 echo " ERROR: failed to fetch release notes from GitHub draft release for version ${ic_version} "
8182 exit 2
@@ -111,7 +112,7 @@ if [ $? -ne 0 ]; then
111112 exit 2
112113fi
113114
114- cd ${DOCS_FOLDER}
115+ cd ${DOCS_FOLDER} || exit 2
115116if [ " ${DEBUG} " != " false" ]; then
116117 echo " DEBUG: Cloned doc repo to ${DOCS_FOLDER} and changed directory"
117118fi
@@ -123,15 +124,15 @@ if [ "${DEBUG}" != "false" ]; then
123124fi
124125
125126echo " INFO: Checking out branch ${branch} in the documentation repository"
126- remote_branch=$( git ls-remote --heads origin ${branch} 2> /dev/null)
127+ remote_branch=$( git ls-remote --heads origin " ${branch} " 2> /dev/null)
127128
128129if [ -n " ${remote_branch} " ]; then
129- git checkout ${branch}
130+ git checkout " ${branch} "
130131 if [ " ${DEBUG} " != " false" ]; then
131132 echo " DEBUG: Checked out existing branch ${branch} "
132133 fi
133134else
134- git checkout -b ${branch}
135+ git checkout -b " ${branch} "
135136 if [ " ${DEBUG} " != " false" ]; then
136137 echo " DEBUG: Created new branch ${branch} "
137138 fi
227228 if [ " ${DEBUG} " != " false" ]; then
228229 echo " DEBUG: Release content starts at line: ${release_start:- ' not found' } "
229230 fi
230- [ -n " ${release_start} " ] && tail -n +${release_start} " ${TMPDIR} /temp_index.md" >> " ${archive_file} "
231+ [ -n " ${release_start} " ] && tail -n +" ${release_start} " " ${TMPDIR} /temp_index.md" >> " ${archive_file} "
231232
232233 # Create new index for new year
233234 echo " INFO: Creating new _index.md for year ${release_year} "
288289 echo " " >> " ${TMPDIR} /final_index.md"
289290 echo " ${release_notes_content} " >> " ${TMPDIR} /final_index.md"
290291 echo " " >> " ${TMPDIR} /final_index.md"
291- tail -n +${insert_line} " ${TMPDIR} /temp_index.md" >> " ${TMPDIR} /final_index.md"
292+ tail -n +" ${insert_line} " " ${TMPDIR} /temp_index.md" >> " ${TMPDIR} /final_index.md"
292293
293294 mv " ${TMPDIR} /final_index.md" " ${index_file_path} "
294295fi
@@ -321,13 +322,13 @@ if [ "${DRY_RUN}" == "false" ]; then
321322 fi
322323
323324 echo " INFO: Pushing changes to the documentation repository"
324- git push origin ${branch}
325+ git push origin " ${branch} "
325326 if [ $? -ne 0 ]; then
326327 echo " ERROR: failed pushing changes to the docs repo"
327328 exit 2
328329 fi
329330 echo " INFO: Creating pull request for the documentation repository"
330- gh pr create --title " Update release notes for ${ic_version} " --body " Update release notes for ${ic_version} " --head ${branch} --draft
331+ gh pr create --title " Update release notes for ${ic_version} " --body " Update release notes for ${ic_version} " --head " ${branch} " --draft
331332else
332333 echo " INFO: DRY_RUN: Showing what would be committed:"
333334 git status --porcelain
0 commit comments