Skip to content

leandro-hermes/action-upload-file

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Upload file javascript action

Uploads a file via HTTP POST using the form-data package.

Inputs

host

Required. Host of the HTTP server (e.g. example.com).

path

Required. Path of the URL to send the file (e.g. /postFile).

filePath

Required. Full path of the local file you want to upload (e.g. /home/user/file.zip).

https

Optional. Type true whether your request must go on HTTPS. Default false.

data

Optional. Additional data you should want to send within the request (e.g. '{"foo":"bar"}').

Outputs

response

The response from the server.

Example usage

on: pull_request
jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - name: Exports the full file path
        id: file
        run: echo "::set-output name=path::$(realpath relative/path/to.file)"

      - uses: leandro-hermes/[email protected]
        with:
          host: 'example.com'
          path: '/postFile'
          filePath: ${{ steps.file.outputs.path }}
          data: ${{ toJson(github.event.pull_request) }}

About

Uploads a file via HTTP POST

Resources

Stars

Watchers

Forks

Packages

No packages published