Skip to content

Handle workflow_dispatch trigger #7

@Aeris1One

Description

@Aeris1One

When a workflow is manually triggered, the commit sha is set to undefined.
This isn't handled properly by this Action which try to run git diff --name-only --diff-filter=AMR -M100% <revisioncommit> undefined

A sample error log would be :

Run swznd/sftp-deploy@master
  with:
    host: ***
    port: ***
    user: ***
    password: ***
    ignore: .github/**,.gitignore,**/.gitignore,**/.git/**
Connected. Current Working Directory: /
Remote Revision: 
Remote revision empty, get from initial commit
/usr/bin/git hash-object -t tree /dev/null
4b825dc642cb6eb9a060e54bf8d69288fbee4904
Comparing 4b825dc642cb6eb9a060e54bf8d69288fbee4904..undefined
/usr/bin/git diff --name-only --diff-filter=AMR -M100% 4b825dc642cb6eb9a060e54bf8d69288fbee4904 undefined
fatal: ambiguous argument 'undefined': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error: The process '/usr/bin/git' failed with exit code 128

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions