Upload file via http request. This is a Js action. Use axios to send and send requests. There is no limit on file size.
This is an example of upload apk to pgyer.com(蒲公英网站)
- name: Upload File
id: upload
uses: JantHsueh/upload-file-action@master
with:
url: https://www.pgyer.com/apiv2/app/upload
forms: '{"_api_key":"${{ secrets.pgyer_key }}","buildInstallType":3}'
fileForms: '{"file":"app/build/outputs/apk/release/app-release.apk"}'
Parameter | Required | Info |
---|---|---|
url |
true |
Web request URL endpoint |
forms |
false |
Data to be transmitted,such as key, pwd, etc. Use json format |
fileForms |
true |
Files to be transferred,such as 'file','image' etc. Use json format. Use empty array if you have no data to send. |
Output format: JSON
{
"output": {
"url": "<str url>",
"method": "<str method>",
"statusCode": "<int statusCode>",
"data": "object/array data from API"
}
}
There is no return time , because this is running on Amazon server,there are some time zone issues. use get-time-action to get the time in your current time zone
run: |
$output = '${{ steps.upload.outputs.output }}' | ConvertFrom-Json
Write-Host "Time from output $($output.time) statusCode $($output.statusCode) data $($output.data)"