Downloads a file from a URL, using a cached version if possible.
Example:
- uses: UoMResearchIT/actions/download@v1.2.3
with:
url: https://research-it.manchester.ac.uk/
local-name: homepage.htmlExample of accessing a protected resource:
- uses: UoMResearchIT/actions/download@v1.2.3
with:
url: https://api.github.com/repo/UoMResearchIT/actions=test/contents/README.md
local-name: read-me.md
content-type: application/vnd.github.raw+json
token: ${{ secrets.MY_ACCESS_TOKEN }}Tip
If using the token input, you almost certainly ought to be getting its value from the
GitHub secrets context.
Warning
This action can potentially exfiltrate the provided token. You should only provide a token if it is necessary to access the URL, and the token was originally created with the intention that it be used to access that URL. Any pull request involving this action should be reviewed carefully if it provides a token.
-
urlThe URL to download from. Required.
-
local-nameThe local file name. Derived from the URL if not given. Must be supplied if the guessed name would be empty. Optional.
-
content-typeThe content type to try to download. Defaults to whatever the server chooses by default. Optional.
Example:
text/html -
tokenA bearer token to present to authorise the download. If not supplied, only public resources may be accessed. Optional.
Example:
${{ secrets.GITHUB_TOKEN }} -
wget-optionsAdditional options to pass to
wget. Optional.
-
filenameThe full path to the file.
No special permissions required.
If a token is supplied, whatever that token is must have permission to access the resource concerned.