Skip to content

Commit e341261

Browse files
committed
Do not generate invalid links in job summaries
1 parent bdc97d1 commit e341261

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: src/ci/scripts/upload-artifacts.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,15 @@ access_url="https://ci-artifacts.rust-lang.org/${deploy_dir}/$(ciCommit)"
5252
# to make them easily accessible.
5353
if [ -n "${GITHUB_STEP_SUMMARY}" ]
5454
then
55-
echo "# CI artifacts" >> "${GITHUB_STEP_SUMMARY}"
55+
archives=($(find "${upload_dir}" -maxdepth 1 -name "*.xz"))
5656

57-
for filename in "${upload_dir}"/*.xz; do
58-
filename=$(basename "${filename}")
59-
echo "- [${filename}](${access_url}/${filename})" >> "${GITHUB_STEP_SUMMARY}"
60-
done
57+
# Avoid generating an invalid "*.xz" file if there are no archives
58+
if [ ${#archives[@]} -gt 0 ]; then
59+
echo "# CI artifacts" >> "${GITHUB_STEP_SUMMARY}"
60+
61+
for filename in "${upload_dir}"/*.xz; do
62+
filename=$(basename "${filename}")
63+
echo "- [${filename}](${access_url}/${filename})" >> "${GITHUB_STEP_SUMMARY}"
64+
done
65+
fi
6166
fi

0 commit comments

Comments
 (0)