garygrossgarten/github-action-ssh

(node:3089) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues

olivertappin opened this issue · 4 comments

When running SSH commands directly on my Digital Ocean instance, I can see the following in the GitHub Workflows output:

(node:3089) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Looking at the following answer from Stack Overflow: https://stackoverflow.com/a/52257416/1421836

It looks like the following matches need changing:

➜  github-action-ssh git:(master) ack 'new Buffer\('
dist/index.js
8602:    needle = new Buffer(needle);
8613:  this._lookbehind = new Buffer(needle_len);
8637:    chunk = new Buffer(chunk, 'binary');

To one of the following:

new Buffer(number)            // Old
Buffer.alloc(number)          // New
new Buffer(string)            // Old
Buffer.from(string)           // New
new Buffer(string, encoding)  // Old
Buffer.from(string, encoding) // New
new Buffer(...arguments)      // Old
Buffer.from(...arguments)     // New

Hi, I just tried to use this example, and had the same problem described by you, @olivertappin .

(node:2569) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

This might be related to this issue. ssh2 ist used as an dependency in nodessh which i am using in this action. This warning will be gone in a future release.

@garygrossgarten Are you going to release a new version with this fix?

same problem