Skip to content

Commit

Permalink
Update README.md with more details
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolai-laevskii committed Oct 9, 2023
1 parent 9f943e4 commit 3ae19a4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,20 @@ Provides shorthands for getting information about platform action is running on.
```js
import { platform } from '@actions/core'
platform.platform // 'win32'
platform.arch // 'x64'
/* equals to a call of os.platform() */
platform.platform // 'win32' | 'darwin' | 'linux' | 'freebsd' | 'openbsd' | 'android' | 'cygwin' | 'sunos'
/* equals to a call of os.arch() */
platform.arch // 'x64' | 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 'riscv64' | 's390' | 's390x'
/* common shorthands for platform-specific logic */
platform.isWindows // true
platform.isMacOS // false
platform.isLinux // false
/* run platform-specific script to get more details about the exact platform, works on Windows, MacOS and Linux */
const {
name, // Microsoft Windows 11 Enterprise
version, // 10.0.22621
} = await platform.getInfo()
} = await platform.getDetails()
```

0 comments on commit 3ae19a4

Please sign in to comment.