actions / actions/toolkit

tool-cache._getOsVersion should improve to detect RHEL compatible Linux distro version.

Open
#1,493 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the enhancement

tool-cache._getOsVersion() had been using /etc/lsb-release to detect Linux OS versions, but recently, it was improved to use /etc/os-release from systemd : #594

But it used VERSION_ID only, and it does not process Linux distro information.

IMHO, the purpose of tool-cache._getOsVersion() is to distinguish the ABI of the OS.
So, I propose to improve it as follows.

  • Return PLATFORM_ID first if it is available from /etc/os-release

    • RHEL based Linux distros provides PLATFORM_ID which OS is compatible.
      • RHEL 8.x, CentOS 8.x, and Rocky Linux 8.x have same PLATFORM_ID=platform:el8
  • Return old behavior (VERSION_ID from /etc/os-release) if PLATFORM_ID is not available.

    • This can keep compatiblity with current behavior.

Code Snippet
If applicable, add a code snippet to show the api enhancement.

Additional information
Add any other context about the feature here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating tool-cache._getOsVersion() and the existing /etc/os-release parsing. Check how VERSION_ID is currently selected, then verify the result for RHEL-compatible distributions with and without PLATFORM_ID. Done means PLATFORM_ID is preferred when present and VERSION_ID remains the fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
operating-systems, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.