Skip to content

Provide a list of files to the src #11

@lfgcampos

Description

@lfgcampos

Is your feature request related to a problem? Please describe ⚡️

I would like to do an automatic rsync but only to the files changes on my last commit.
AFAIK, rsync supports this but I am not sure if the action does.

Describe the solution you'd like ✨

Using bash/git, I can get a list of changed files and would like to use them as my input src making sure only those files are rsync-ed.

Describe alternatives you've considered 🎡

N/A

Additional context 🖼

An example would be something like this:

jobs:
  changed-files:
    name: Changed files
    runs-on: ubuntu-latest
    # Map a step output to a job output
    outputs:
      all: ${{ steps.changes.outputs.all}}
    steps:
        # Make sure we have some code to diff.
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Get changed files
        id: changes
        # Set outputs using the command.
        run: |
          echo "::set-output name=all::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)"

  deploy:
    - name: Deploy to server
      id: deploy
      uses: Pendect/[email protected]
      env:
        DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
      with:
        flags: '-avzr --delete'
        options: ''
        ssh_options: ''
        src: '${{needs.changed-files.outputs.all}}'
        dest: '[email protected]:/var/www/server.com'

    - name: Display status from deploy
      run: echo "${{ steps.deploy.outputs.status }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions