From e5f04f29ed5ae1f23223152c91dfa3780633bd1a Mon Sep 17 00:00:00 2001 From: MuhXd <100521306+MuhXd@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:03:16 +0000 Subject: [PATCH] Retry The download because just in case --- .github/workflows/issuecomment.yml | 45 +++++++++++++++++------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/issuecomment.yml b/.github/workflows/issuecomment.yml index 5dd72d5..81ead24 100644 --- a/.github/workflows/issuecomment.yml +++ b/.github/workflows/issuecomment.yml @@ -54,26 +54,31 @@ jobs: - name: Download File if: steps.verify_user.outputs.result == 'YES' && github.event.comment.body == '!accept' - id: download_file - shell: bash - run: | - set +e - python3 code/.github/DOWNLOAD_FILE.py >> result.txt - RESULT=$? - set -e - - cat result.txt - - echo "any silly errors?" - if [ -f silly_log.txt ]; then - cat silly_log.txt - fi - - if [ $RESULT -eq 0 ]; then - echo push_entry=YES >> $GITHUB_OUTPUT - else - echo push_entry=NO >> $GITHUB_OUTPUT - fi + uses: nick-fields/retry@v3 + with: + timeout_minutes: 2 + max_attempts: 5 + shell: bash + command: | + set +e + python3 code/.github/DOWNLOAD_FILE.py >> result.txt + RESULT=$? + set -e + + cat result.txt + + echo "any silly errors?" + if [ -f silly_log.txt ]; then + cat silly_log.txt + fi + + if [ $RESULT -eq 0 ]; then + echo "Download successful, proceeding with next steps." + exit 0 + else + echo "Download failed, retrying..." + exit 1 + fi env: ISSUE_AUTHOR: ${{ github.event.issue.user.login }} COMMENT_AUTHOR: ${{ github.event.comment.user.login }}