GitHub Action to download a file from the internet into the workspace.
file-url: (Required) The URL of the file to download.file-name: (Optional) A new filename to rename the downloaded file.location: (Optional) A path to download the file.md5: (Optional) An MD5 hash to verify the download.sha256: (Optional) An SHA256 hash to verify the download.authentication: (Optional) Type of authentication - either (None|Basic|Token).username: (Optional) Used forBasicauthentication.password: (Optional) Used forBasicauthentication.token: (Optional) An authentication token to include in theAuthorizationheader.
file-path: The full path to the downloaded file.
In its simplest form you can you indicate what file to download and use it:
- name: Download a fileuses: carlosperate/download-file-action@v1with: file-url: 'https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py' - name: Check the file is thererun: ls -l get-poetry.pyTo use all the options:
- name: Download a fileuses: carlosperate/download-file-action@v1id: download-filewith: file-url: 'https://github.com/carlosperate/download-file-action/archive/refs/tags/v1.0.3.tar.gz'file-name: 'new_filename.tar.gz'location: './new-folder-to-be-created'md5: 'e3b51204dedc75588ca164a26b51610d'sha256: '76ef5cf6e910a4955f713fb36cca6f90ffeee6ffafe743754716e149d68136de' - name: Print the file path (new-folder-to-be-created/new_filename.tar.gz)run: echo "The file was downloaded to ${{steps.download-file.outputs.file-path }}"