Skip to content

Commit

Permalink
retry download action (#383)
Browse files Browse the repository at this point in the history
* added retry logic to download action

* minor

* descriptions
  • Loading branch information
NicolajAaH authored Jun 19, 2024
1 parent aa1a5b7 commit f572c52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
25 changes: 16 additions & 9 deletions .github/actions/download-and-unzip-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,29 @@ description: Download and unzip release
inputs:
destination_folder_path:
required: true
description: Path where unzipped files should be located
release_repository_path:
required: true
description: Path to the repository where the release is located
release_name:
required: true
description: Name of the release to download

runs:
using: composite
steps:
- name: Download release
shell: bash
run: |
repo="${{ inputs.release_repository_path }}"
uses: nick-fields/retry@v3
with:
timeout_seconds: 30
max_attempts: 3
shell: bash
command: |
repo="${{ inputs.release_repository_path }}"
if echo $repo | grep -iqF "energinet-datahub"; then
gh release download -R "${{ inputs.release_repository_path }}" ${{ inputs.release_name }} -p "${{ inputs.release_name }}.zip"
else
wget https://github.com/${{ inputs.release_repository_path }}/releases/download/${{ inputs.release_name }}/${{ inputs.release_name }}.zip
fi
unzip ${{ inputs.release_name }}.zip -d ${{ inputs.destination_folder_path }}
if echo $repo | grep -iqF "energinet-datahub"; then
gh release download -R "${{ inputs.release_repository_path }}" ${{ inputs.release_name }} -p "${{ inputs.release_name }}.zip"
else
wget https://github.com/${{ inputs.release_repository_path }}/releases/download/${{ inputs.release_name }}/${{ inputs.release_name }}.zip
fi
unzip ${{ inputs.release_name }}.zip -d ${{ inputs.destination_folder_path }}
2 changes: 1 addition & 1 deletion .github/workflows/create-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# BE AWARE --> Updating to a new MAJOR version will delete deprecated versions on a nightly schedule.
# See https://github.com/Energinet-DataHub/.github#release-procedure for details
major_version: 14
minor_version: 8
minor_version: 9
patch_version: 0
repository_path: Energinet-DataHub/.github
usage_patterns: \s*uses:\s*Energinet-DataHub/\.github(.*)@v?(?<version>\d+)
Expand Down

0 comments on commit f572c52

Please sign in to comment.