toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

platform is undefined

Open domino14 opened this issue 1 year ago • 3 comments

Describe the bug

platform is undefined

To Reproduce Steps to reproduce the behavior:

  1. Create an index.js script that looks like:
import { platform } from "@actions/core";

console.log("platform is", platform);
  1. Create a new action that calls this script
  2. Invoke the action in another repo
  3. The console prints out "platform is undefined"

Expected behavior platform should be defined and have arch info as well.

Desktop (please complete the following information):

  • OS: Linux

domino14 avatar Jan 23 '24 21:01 domino14

I have the same issue in a TypeScript action.

The documentation has an example how to use it, but indeed it's not defined.

AnHeuermann avatar Mar 05 '24 08:03 AnHeuermann

The PR that added it hasn't been included in a release yet. Until then you can use node:os as per the PR.

samhh avatar Jul 24 '24 14:07 samhh