sand4rt / ftp-deployer

Simple SFTP / FTP deployment with NodeJS.
https://github.com/marketplace/actions/ftp-deployer
MIT License
47 stars 12 forks source link

confusing action param #7

Closed StageGuard closed 3 years ago

StageGuard commented 3 years ago

It says in readme:

    include: '' # optional, e.g.
      # - dist
    exclude: '' # optional
      # - node_modules/**
      # - node_modules/**/.*
      # - .git/**
      # - *.env

seems that I need to provide a yaml raw list, but actually: index.js

include: JSON.parse(core.getInput('include')) || ['*', '**/*'], // this would upload everything except dot files
exclude: JSON.parse(core.getInput('exclude')) || ['node_modules/**', 'node_modules/**/.*', '.git/**'], // e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)

It parses a json array string. I think no one will understand how to deploy this action until he or she read index.js

sand4rt commented 3 years ago

Hello, thanks for making an issue. I changed the readme for now (because i lack the time to fix it). Would be nice if we could change the parser. Fancy to open a PR?

joaosouz4dev commented 3 years ago

@sand4rt I was in doubt how to use the delete in fact, can you tell me how to use it, I would like to delete the folder .github and nbproject?

sand4rt commented 3 years ago

@sand4rt I was in doubt how to use the delete in fact, can you tell me how to use it, I would like to delete the folder .github and nbproject?

Add the the folders to the exclude array like:


- name: FTP Deployer
  uses: sand4rt/ftp-deployer@v1.3
  with:
    sftp: false # optional
    host: ${{ secrets.FTP_HOST }} # e.g. ftp.host.com or sftp.host.com (without ftp:// or ftps://)
    port: 21 # optional, default is: 21
    username: ${{ secrets.FTP_USERNAME }} # FTP username
    password: ${{ secrets.FTP_PASSWORD }} # FTP password
    remote_folder: ${{ secrets.FTP_REMOTE_FOLDER }} # optional, remote path of your FTP server
    local_folder: dist # optional, local path, default is: dist
    cleanup: false # optional, remove existing files inside FTP remote folder
    include: [] # optional, e.g. ['dist']
    exclude: ['node_modules/**', '.git/**', '*.env', '.github/**', 'nbproject/**']
    pasive: true # optional