GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add platform info utilities to @actions/core by nikolai-laevskii · Pull Request #1551 · actions/toolkit

Conversation

@nikolai-laevskii

@nikolai-laevskii nikolai-laevskii commented Oct 9, 2023

Copy link
Copy Markdown
Contributor

Adds shorthands for getting information about platform action is running on:

import { platform } from '@actions/core'

/* same as os.platform() */
platform.platform // 'win32' | 'darwin' | 'linux' | 'freebsd' | 'openbsd' | 'android' | 'cygwin' | 'sunos'

/* same as 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.getDetails()

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dhensby and parkerbxyz reacted with heart emoji 77553322AHST reacted with eyes emoji
All reactions
  • ❤️ 2 reactions
  • 👀 1 reaction
nikolai-laevskii added 5 commits October 9, 2023 05:36
@nikolai-laevskii
Introduce platform utilities into @actions/core
dccd7ee
@nikolai-laevskii
Add tests for the platform helper
ecfb90c
@nikolai-laevskii
Update README.md
cdf9123
@nikolai-laevskii
Merge remote-tracking branch 'actions/main' into add-platform-info-ut…
9f943e4
…ilities
@nikolai-laevskii
Update README.md with more details
3ae19a4
@nikolai-laevskii
nikolai-laevskii requested a review from a team as a code owner October 9, 2023 03:54
@nikolai-laevskii nikolai-laevskii mentioned this pull request Oct 9, 2023
Add platform info utilities akv-platform/toolkit#1
Closed
@nikolai-laevskii nikolai-laevskii changed the title Add platform info utilities Add platform info utilities to @actions/core Oct 9, 2023
luketomlinson
luketomlinson approved these changes Nov 1, 2023
View reviewed changes
@luketomlinson
luketomlinson merged commit 20f826b into actions:main Nov 14, 2023
joshmgross added a commit that referenced this pull request Oct 2, 2024
@joshmgross
Include #1551 in @actions/core 1.11.0 release notes
cd65b98
@joshmgross joshmgross mentioned this pull request Oct 2, 2024
Include #1551 in @actions/core 1.11.0 release notes #1840
Merged
joshmgross added a commit that referenced this pull request Oct 2, 2024
@joshmgross
Include #1551 in @actions/core 1.11.0 release notes (#1840)
22a72ac
@dhensby

dhensby commented Oct 8, 2024

Copy link
Copy Markdown

I just want to say that I really appreciate this bit of functionality - thanks @nikolai-laevskii - it's allowed me to remove some custom code from my own action 🎉

joshmgross reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Derrick-MUGISHA pushed a commit to Derrick-MUGISHA/toolkit that referenced this pull request Oct 12, 2026
@nikolai-laevskii
Add platform info utilities to @actions/core (actions#1551)
5f5a88c
* Introduce platform utilities into @actions/core

* Add tests for the platform helper

* Update README.md

* Update README.md with more details
Derrick-MUGISHA pushed a commit to Derrick-MUGISHA/toolkit that referenced this pull request Oct 12, 2026
@joshmgross
Include actions#1551 in @actions/core 1.11.0 release notes (actions…
06a3aed
…#1840)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@luketomlinson luketomlinson luketomlinson approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@nikolai-laevskii @dhensby @luketomlinson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.