Skip to content

Commit 3ad4064

Browse files
committed
Fix shellcheck quoting in Spring workflows
1 parent 8cdc57f commit 3ad4064

3 files changed

Lines changed: 39 additions & 37 deletions

File tree

.github/workflows/test-spring-boot-rc-version.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,45 +38,45 @@ jobs:
3838
mapfile -t versions < spring-versions.txt
3939
{
4040
echo "need_update_version=true"
41-
echo "update_branch=update-spring-dependencies-$(date +%Y%m%d)-${GITHUB_RUN_ID}"
42-
echo "spring_boot_version=${versions[0]}"
43-
echo "spring_cloud_version=${versions[1]}"
44-
echo "pr_descriptions=$(<pr-descriptions.txt)"
45-
echo "PR_TITLE=Test Spring Boot RC version ${versions[0]} and Spring Cloud ${versions[1]}"
46-
} >> $GITHUB_ENV
41+
printf 'update_branch=update-spring-dependencies-%s-%s\n' "$(date +%Y%m%d)" "${GITHUB_RUN_ID}"
42+
printf 'spring_boot_version=%s\n' "${versions[0]}"
43+
printf 'spring_cloud_version=%s\n' "${versions[1]}"
44+
printf 'pr_descriptions=%s\n' "$(<pr-descriptions.txt)"
45+
printf 'PR_TITLE=Test Spring Boot RC version %s and Spring Cloud %s\n' "${versions[0]}" "${versions[1]}"
46+
} >> "$GITHUB_ENV"
4747
else
4848
echo "No RC version, cancel update!"
4949
fi
5050
- name: Generate spring_boot_managed_external_dependencies.txt
5151
if: ${{ env.need_update_version == 'true' }}
5252
run: |
53-
echo Updating Spring Boot Dependencies Version: ${{ env.spring_boot_version }}
54-
echo Updating Spring Cloud Dependencies Version: ${{ env.spring_cloud_version }}
53+
echo "Updating Spring Boot Dependencies Version: ${{ env.spring_boot_version }}"
54+
echo "Updating Spring Cloud Dependencies Version: ${{ env.spring_cloud_version }}"
5555
git checkout -b "${{ env.update_branch }}"
5656
pip install termcolor
57-
python ./sdk/spring/scripts/get_spring_boot_managed_external_dependencies.py -b ${{ env.spring_boot_version }} -c ${{ env.spring_cloud_version }}
57+
python ./sdk/spring/scripts/get_spring_boot_managed_external_dependencies.py -b "${{ env.spring_boot_version }}" -c "${{ env.spring_cloud_version }}"
5858
- name: Update external_dependencies.txt
5959
if: ${{ env.need_update_version == 'true' }}
6060
run: |
6161
pip install termcolor
6262
pip install in_place
63-
python ./sdk/spring/scripts/sync_external_dependencies.py -b ${{ env.spring_boot_version }} -sbmvn 4
63+
python ./sdk/spring/scripts/sync_external_dependencies.py -b "${{ env.spring_boot_version }}" -sbmvn 4
6464
- name: Update Versions
6565
if: ${{ env.need_update_version == 'true' }}
6666
run: |
6767
python ./eng/versioning/update_versions.py --sr
6868
- name: Update ChangeLog
6969
if: ${{ env.need_update_version == 'true' }}
7070
run: |
71-
python ./sdk/spring/scripts/update_changelog.py -b ${{ env.spring_boot_version }} -c ${{ env.spring_cloud_version }}
71+
python ./sdk/spring/scripts/update_changelog.py -b "${{ env.spring_boot_version }}" -c "${{ env.spring_cloud_version }}"
7272
- name: Push Commit
7373
if: ${{ env.need_update_version == 'true' }}
7474
run: |
7575
git config --global user.email github-actions@github.com
7676
git config --global user.name github-actions
7777
git add -A
7878
git commit -m "Upgrade external dependencies to align with Spring Boot ${{ env.spring_boot_version }}"
79-
sed -i "s/NONE_SUPPORTED_SPRING_CLOUD_VERSION/${spring_cloud_version}/g" ./sdk/spring/pipeline/spring-cloud-azure-supported-spring.json
79+
sed -i "s/NONE_SUPPORTED_SPRING_CLOUD_VERSION/${spring_cloud_version}/g" "./sdk/spring/pipeline/spring-cloud-azure-supported-spring.json"
8080
git add ./sdk/spring/pipeline/spring-cloud-azure-supported-spring.json
8181
git commit -m "Upgrade spring-cloud-azure-supported-spring"
8282
git push origin "HEAD:${{ env.update_branch }}"

.github/workflows/update-spring-cloud-azure-support-file.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ jobs:
5959
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
6060
GITHUB_ACTION_URL="https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
6161
62-
echo "BRANCH_NAME=update-spring-cloud-azure-support-file-${TIMESTAMP}" >> $GITHUB_ENV
63-
64-
echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
65-
echo "${PR_TITLE}." >> $GITHUB_ENV
66-
echo "This commit is created by GitHub Action: ${GITHUB_ACTION_URL}" >> $GITHUB_ENV
67-
echo "EOF" >> $GITHUB_ENV
68-
69-
echo "PULL_REQUEST_BODY<<EOF" >> $GITHUB_ENV
70-
echo "${PR_TITLE}." >> $GITHUB_ENV
71-
echo "This commit is created by GitHub Action: ${GITHUB_ACTION_URL}" >> $GITHUB_ENV
72-
echo "EOF" >> $GITHUB_ENV
62+
{
63+
echo "BRANCH_NAME=update-spring-cloud-azure-support-file-${TIMESTAMP}"
64+
echo "COMMIT_MESSAGE<<EOF"
65+
echo "${PR_TITLE}."
66+
echo "This commit is created by GitHub Action: ${GITHUB_ACTION_URL}"
67+
echo "EOF"
68+
echo "PULL_REQUEST_BODY<<EOF"
69+
echo "${PR_TITLE}."
70+
echo "This commit is created by GitHub Action: ${GITHUB_ACTION_URL}"
71+
echo "EOF"
72+
} >> "$GITHUB_ENV"
7373
- name: Make Decision Based on Git Diff
7474
run: |
7575
git checkout -b "${{ env.BRANCH_NAME }}"
7676
if [[ -n "$(git status -s)" ]]; then
77-
echo "NEED_UPDATE_FILE=true" >> $GITHUB_ENV
77+
echo "NEED_UPDATE_FILE=true" >> "$GITHUB_ENV"
7878
else
7979
echo "No file changes, no commits."
8080
fi

.github/workflows/update-spring-dependencies.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,37 +63,39 @@ jobs:
6363
elif grep -q -- '-' spring-versions.txt; then
6464
echo "Has non-GA version, cancel update!"
6565
else
66-
echo "need_update_version=true" >> $GITHUB_ENV
67-
echo "update_branch=update-spring-dependencies-$(date +%Y%m%d)-${GITHUB_RUN_ID}" >> $GITHUB_ENV
68-
echo "spring_boot_version=$(sed -n '1p' spring-versions.txt)" >> $GITHUB_ENV
69-
echo "spring_cloud_version=$(sed -n '2p' spring-versions.txt)" >> $GITHUB_ENV
70-
echo "last_spring_boot_version=$(sed -n '3p' spring-versions.txt)" >> $GITHUB_ENV
71-
echo "last_spring_cloud_version=$(sed -n '4p' spring-versions.txt)" >> $GITHUB_ENV
72-
echo "pr_descriptions=$(cat pr-descriptions.txt)" >> $GITHUB_ENV
73-
echo "PR_TITLE=${PR_TITLE_PREFIX} $(sed -n '1p' spring-versions.txt) and Spring Cloud $(sed -n '2p' spring-versions.txt)" >> $GITHUB_ENV
66+
{
67+
echo "need_update_version=true"
68+
printf 'update_branch=update-spring-dependencies-%s-%s\n' "$(date +%Y%m%d)" "${GITHUB_RUN_ID}"
69+
printf 'spring_boot_version=%s\n' "$(sed -n '1p' spring-versions.txt)"
70+
printf 'spring_cloud_version=%s\n' "$(sed -n '2p' spring-versions.txt)"
71+
printf 'last_spring_boot_version=%s\n' "$(sed -n '3p' spring-versions.txt)"
72+
printf 'last_spring_cloud_version=%s\n' "$(sed -n '4p' spring-versions.txt)"
73+
printf 'pr_descriptions=%s\n' "$(cat pr-descriptions.txt)"
74+
printf 'PR_TITLE=%s %s and Spring Cloud %s\n' "${PR_TITLE_PREFIX}" "$(sed -n '1p' spring-versions.txt)" "$(sed -n '2p' spring-versions.txt)"
75+
} >> "$GITHUB_ENV"
7476
fi
7577
- name: Generate spring_boot_managed_external_dependencies.txt
7678
if: ${{ env.need_update_version == 'true' }}
7779
run: |
78-
echo Updating Spring Boot Dependencies Version: ${{ env.spring_boot_version }}
79-
echo Updating Spring Cloud Dependencies Version: ${{ env.spring_cloud_version }}
80+
echo "Updating Spring Boot Dependencies Version: ${{ env.spring_boot_version }}"
81+
echo "Updating Spring Cloud Dependencies Version: ${{ env.spring_cloud_version }}"
8082
git checkout -b "${{ env.update_branch }}"
8183
pip install termcolor
82-
python ./sdk/spring/scripts/get_spring_boot_managed_external_dependencies.py -b ${{ env.spring_boot_version }} -c ${{ env.spring_cloud_version }}
84+
python ./sdk/spring/scripts/get_spring_boot_managed_external_dependencies.py -b "${{ env.spring_boot_version }}" -c "${{ env.spring_cloud_version }}"
8385
- name: Update external_dependencies.txt
8486
if: ${{ env.need_update_version == 'true' }}
8587
run: |
8688
pip install termcolor
8789
pip install in_place
88-
python ./sdk/spring/scripts/sync_external_dependencies.py -b ${{ env.spring_boot_version }} -sbmvn 4
90+
python ./sdk/spring/scripts/sync_external_dependencies.py -b "${{ env.spring_boot_version }}" -sbmvn 4
8991
- name: Update Versions
9092
if: ${{ env.need_update_version == 'true' }}
9193
run: |
9294
python ./eng/versioning/update_versions.py --sr
9395
- name: Update ChangeLog
9496
if: ${{ env.need_update_version == 'true' }}
9597
run: |
96-
python ./sdk/spring/scripts/update_changelog.py -b ${{ env.spring_boot_version }} -c ${{ env.spring_cloud_version }}
98+
python ./sdk/spring/scripts/update_changelog.py -b "${{ env.spring_boot_version }}" -c "${{ env.spring_cloud_version }}"
9799
- name: Push Commit
98100
if: ${{ env.need_update_version == 'true' }}
99101
run: |

0 commit comments

Comments
 (0)