ERROR: Github error response [422]: Invalid request. "sha" wasn't supplied

This error comes when using Upload Binary File to GitHub option.

If the file is already present with the same name, This error happens.

ERROR: Github error response [422]: Invalid request. "sha" wasn't supplied.
Error: Github error response [422]: Invalid request.

"sha" wasn't supplied.
    at Object.githubApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Github/GenericFunctions.js:42:19)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Github/Github.node.js:1662:32)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:416:47

Any way to avoid this error?

Found this thread, Might be Useful:

I guess you have two options, depending on what you want to do.

  1. Delete the file before uploading a change.

  2. Check if the file exists; if it does, then do not update it.

1 Like

Thanks bro. Solved