Skip to content

Commit

Permalink
subfolder fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simple-elf committed Apr 2, 2021
1 parent f9356a7 commit 9ba7223
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ if [[ ${INPUT_SUBFOLDER} != '' ]]; then
echo "NEW github pages url ${GITHUB_PAGES_WEBSITE_URL}"
fi

echo "count folders in allure-history"
echo $( ( ls ./${INPUT_ALLURE_HISTORY} | wc -l ) )
echo "keep reports count ${INPUT_KEEP_REPORTS} $((INPUT_KEEP_REPORTS+1))"
if [[ $((INPUT_KEEP_REPORTS+1)) < $( ( ls ./${INPUT_ALLURE_HISTORY} | wc -l ) ) ]]; then
COUNT=$( ( ls ./${INPUT_ALLURE_HISTORY} | wc -l ) )
echo "count folders in allure-history: ${COUNT}"
echo "keep reports count ${INPUT_KEEP_REPORTS}"
INPUT_KEEP_REPORTS=$((INPUT_KEEP_REPORTS+1))
echo "if ${COUNT} > ${INPUT_KEEP_REPORTS}"
if (( COUNT > INPUT_KEEP_REPORTS )); then
cd ./${INPUT_ALLURE_HISTORY}
echo "remove index.html last-history"
rm index.html last-history -rv
echo "remove old reports"
ls | sort -n | head -n -$((${INPUT_KEEP_REPORTS}-1)) | xargs rm -rv;
cd ..
ls | sort -n | head -n -$((${INPUT_KEEP_REPORTS}-2)) | xargs rm -rv;
cd ${GITHUB_WORKSPACE}
fi

#echo "index.html"
Expand Down

0 comments on commit 9ba7223

Please sign in to comment.