Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@actions/artifact: [DEP0005] DeprecationWarning caused when used in @actions/download-artifact #2003

Open
MikeMcC399 opened this issue Mar 26, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@MikeMcC399
Copy link

MikeMcC399 commented Mar 26, 2025

Describe the bug

@actions/artifact causes a Node.js DEP0005 deprecation warning in @actions/download-artifact

(node:2042) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ... to show where the warning was created)

To Reproduce

View logs of https://github.com/actions/download-artifact/actions/workflows/test.yml?query=branch%3Amain

Select the most recent run

  • Build (ubuntu-latest)
    • Job Download artifact A
      Scroll down to DEP0005

Note DEP0005 deprecation warning.

To Debug

Add the following to https://github.com/actions/download-artifact/actions/workflows/test.yml and run:

env:
  NODE_OPTIONS: --trace-deprecation
(node:2063) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    at showFlaggedDeprecation (node:buffer:191:11)
    at new Buffer (node:buffer:269:3)
    at new UnzipStream (/home/runner/work/download-artifact/download-artifact/dist/index.js:110127:17)
    at new Extract (/home/runner/work/download-artifact/download-artifact/dist/index.js:109833:24)
    at Object.Extract (/home/runner/work/download-artifact/download-artifact/dist/index.js:109828:12)
    at /home/runner/work/download-artifact/download-artifact/dist/index.js:2240:46
    at new Promise (<anonymous>)
    at /home/runner/work/download-artifact/download-artifact/dist/index.js:2221:16
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/download-artifact/download-artifact/dist/index.js:2150:58)

Add the following to https://github.com/actions/toolkit/blob/main/.github/workflows/artifact-tests.yml and run:

env:
  NODE_OPTIONS: "--pending-deprecation --trace-deprecation"
(node:2215) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    at showFlaggedDeprecation (node:buffer:191:11)
    at new Buffer (node:buffer:269:3)
    at new UnzipStream (/home/runner/work/toolkit/toolkit/packages/artifact/node_modules/unzip-stream/lib/unzip-stream.js:47:17)
    at new Extract (/home/runner/work/toolkit/toolkit/packages/artifact/node_modules/unzip-stream/lib/extract.js:15:24)
    at Object.Extract (/home/runner/work/toolkit/toolkit/packages/artifact/node_modules/unzip-stream/lib/extract.js:10:12)
    at /home/runner/work/toolkit/toolkit/packages/artifact/lib/internal/download/download-artifact.js:118:46
    at new Promise (<anonymous>)
    at /home/runner/work/toolkit/toolkit/packages/artifact/lib/internal/download/download-artifact.js:99:16
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/toolkit/toolkit/packages/artifact/lib/internal/download/download-artifact.js:28:58)

Expected behavior

Using @actions/artifact should not cause a Node.js DEP0005 deprecation warning to be displayed when used in a GitHub JavaScript Action such as @actions/download-artifact

Additional context

This repo uses

"unzip-stream": "^0.3.1"

https://www.npmjs.com/package/unzip-stream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant