Open khertg opened 2 years ago
Please check if sync
input value does not have leading/trailing space.
I'm getting this too:
From the .yaml:
no trailing/leading spaces. Tried both "delta" and "full". The error seems to not know what the value is, there is a : then a . but no erroneous value
Invalid synchronization: .
Could you please share action log after enabling debug
input parameter.
Here are the logs, although it worked today:
@mattlag Thank you for providing action logs. It the same workflow did ran properly then I am guessing it was a temporary glitch with action runner.
Thanks for being responsive, but I used it all yesterday with no problems 👍
@milanmk
I have encountered this issue and found the cause ,well for my problem anyway. When trigging the deployment via a repo dispatch the following worked, however when trying to run the workflow manually, it would have the same issue as above.
The following is a cutdown example.
on:
repository_dispatch:
types: [production-release]
workflow_dispatch:
.....
- name: Deploy assets library to netstorage (CDN)
uses: milanmk/actions-file-deployer@1.11
with:
remote-protocol: 'sftp'
remote-host: ${{ inputs.cdnRemoteHost }}
remote-user: 'sshacs'
ssh-private-key: ${{ inputs.cdnPrivateKey }}
remote-path: ${{ inputs.cdnRemotePath }}
local-path: asset
sync: full
ssh-options: '-oHostKeyAlgorithms=+ssh-dss'
ftp-options: 'set cmd:fail-exit true'
The root cause of my issue was that the input_sync expects the sync input to come from the workflow inputs when I manually trigger the workflow.
Basically my input was being overridden by the default input.sync
input_sync=${{inputs.sync}}
if [ "${{github.event_name}}" == "workflow_dispatch" ]; then
input_sync=${{github.event.inputs.sync}}
fi
You should have an input for workflow_dispatch like shown in the readme workflow example.
workflow_dispatch:
inputs:
sync:
description: "File synchronization"
required: true
default: "delta"
I would argue that it's a flaw to have 2 ways to provide the sync where one overrides the other depending on how the workflow is triggered.
It should be changed so you do not need to provide a workflow_dispatch as not everyone wants to have a workflow dispatch as they would rather just provide what is required for the action in the usage of the action.
Or at the very least the error message needs to be clear, ie go read this bit of the docs which explains why I am getting this error.
As Invalid synchronization: . Valid types are 'delta' and 'full'
is not helpful when you think you are providing it.
I am trying this with manual trigger of the github action.
I do set sync in the settings:
- name: sftp deploy
uses: milanmk/actions-file-deployer@master
with:
remote-protocol: "sftp"
remote-port: 22
remote-host: ${{ secrets.DEPLOY_HOST }}
remote-user: ${{ secrets.DEPLOY_USER }}
remote-password: ${{ secrets.DEPLOY_PASS }}
proxy: false
sync: "full"
local-path: "./public/*"
remote-path: "test""
which leads to Invalid synchronization: . Valid types are 'delta' and 'full'
however when I additionally add sync to the input settings:
workflow_dispatch:
inputs:
sync:
description: "File synchronization"
required: true
default: "full"
it seems to work.
Why do I have to set sync twice?