Skip to content

eak24/download-file-action

Repository files navigation

download-file-action

Workflow To Test Action

GitHub Action to download a file from the internet into the workspace.

Inputs

  • 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 for Basic authentication.
  • password: (Optional) Used for Basic authentication.
  • token: (Optional) An authentication token to include in the Authorization header.

Outputs

  • file-path: The full path to the downloaded file.

Example usage

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.py

To 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 }}"

About

GitHub Action to download a file from the internet into the workspace to use in your workflow.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript59.0%
  • TypeScript41.0%