Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolai-laevskii committed Aug 10, 2023
1 parent 9a80344 commit 572370e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,22 @@ toPlatformPath('/foo/bar') // => \foo\bar
// On a Linux runner.
toPlatformPath('\\foo\\bar') // => /foo/bar
```

#### Platform helper

Provides shorthands for getting information about platform action is running on.

```js
import { platform } from '@actions/core'
platform.platform // 'win32'
platform.arch // 'x64'
platform.isWindows // true
platform.isMacOS // false
platform.isLinux // false
const {
name, // Microsoft Windows 11 Enterprise
version, // 10.0.22621
} = await platform.getInfo()
```

0 comments on commit 572370e

Please sign in to comment.