diff --git a/.github/workflows/script-test.yml b/.github/workflows/script-test.yml
index f73ad27b..5c880390 100644
--- a/.github/workflows/script-test.yml
+++ b/.github/workflows/script-test.yml
@@ -140,34 +140,38 @@ jobs:
fi
done
-
- name: Post error comments
run: |
ERROR="false"
- SEARCH_LINE=".github/workflows/scripts/app-test/pr-build.func: line 255"
+ SEARCH_LINE=".github/workflows/scripts/app-test/pr-build.func: line 255:"
+
+ # Get all existing comments on the PR
+ EXISTING_COMMENTS=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json comments --jq '.comments[].body')
+
for FILE in ${{ env.ALL_FILES }}; do
STRIPPED_NAME=$(basename "$FILE" | sed 's/-install//' | sed 's/\.sh$//')
if [[ ! -f result_$STRIPPED_NAME.log ]]; then
continue
fi
ERROR_MSG=$(cat result_$STRIPPED_NAME.log)
-
+
if [ -n "$ERROR_MSG" ]; then
CLEANED_ERROR_MSG=$(echo "$ERROR_MSG" | sed "s|$SEARCH_LINE.*||")
- echo "Posting error message for $FILE"
- echo ${CLEANED_ERROR_MSG}
- gh pr comment ${{ github.event.pull_request.number }} \
- --repo ${{ github.repository }} \
- --body ":warning: The script _**$FILE**_ failed with the following message: