{"id":22682194,"url":"https://github.com/andry81-devops/gh-action--check-os-version","last_synced_at":"2025-03-29T14:22:42.820Z","repository":{"id":65158891,"uuid":"530283153","full_name":"andry81-devops/gh-action--check-os-version","owner":"andry81-devops","description":"GitHub composite action to check and read OS version details into variables. • :page_with_curl: https://github.com/andry81-stats/gh-action--check-os-version--gh-stats :page_with_curl:","archived":false,"fork":false,"pushed_at":"2025-02-03T01:08:51.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T06:20:09.924Z","etag":null,"topics":["action","comosite-action","github-action","version"],"latest_commit_sha":null,"homepage":"https://github.com/andry81-devops/github-action-extensions","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andry81-devops.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://github.com/andry81/donate"]}},"created_at":"2022-08-29T15:36:58.000Z","updated_at":"2025-02-03T01:08:55.000Z","dependencies_parsed_at":"2024-12-09T20:26:56.619Z","dependency_job_id":"b7cb5796-68d3-4b83-9f14-c69e7296f14b","html_url":"https://github.com/andry81-devops/gh-action--check-os-version","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andry81-devops%2Fgh-action--check-os-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andry81-devops%2Fgh-action--check-os-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andry81-devops%2Fgh-action--check-os-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andry81-devops%2Fgh-action--check-os-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andry81-devops","download_url":"https://codeload.github.com/andry81-devops/gh-action--check-os-version/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246193830,"owners_count":20738554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","comosite-action","github-action","version"],"created_at":"2024-12-09T20:25:45.069Z","updated_at":"2025-03-29T14:22:42.797Z","avatar_url":"https://github.com/andry81-devops.png","language":null,"funding_links":["https://github.com/andry81/donate"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"#\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/metrics/shields-repo-size.svg\" valign=\"middle\" alt=\"GitHub repo size in bytes\" /\u003e\u003c/a\u003e\r\n\u003c!-- -- \u003e\r\n• \u003ca href=\"#\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/metrics/shields-code-size.svg\" valign=\"middle\" alt=\"code size in bytes\" /\u003e\u003c/a\u003e\r\n\u003c!-- --\u003e\r\n• \u003ca href=\"https://github.com/XAMPPRocky/tokei\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/metrics/tokei-lines-of-code.svg\" valign=\"middle\" alt=\"lines of code by tokei.rs\" /\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://github.com/andry81-stats/gh-action--check-os-version--gh-stats/commits/master/traffic/views\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/views/all.svg\" valign=\"middle\" alt=\"GitHub views|any|total\" /\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/views/all-14d.svg\" valign=\"middle\" alt=\"GitHub views|any|14d\" /\u003e\u003c/a\u003e\r\n• \u003ca href=\"https://github.com/andry81-stats/gh-action--check-os-version--gh-stats/commits/master/traffic/views\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/views/unq.svg\" valign=\"middle\" alt=\"GitHub views|unique per day|total\" /\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/views/unq-14d.svg\" valign=\"middle\" alt=\"GitHub views|unique per day|14d\" /\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://github.com/andry81-stats/gh-action--check-os-version--gh-stats/commits/master/traffic/clones\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/clones/all.svg\" valign=\"middle\" alt=\"GitHub clones|any|total\" /\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/clones/all-14d.svg\" valign=\"middle\" alt=\"GitHub clones|any|14d\" /\u003e\u003c/a\u003e\r\n• \u003ca href=\"https://github.com/andry81-stats/gh-action--check-os-version--gh-stats/commits/master/traffic/clones\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/clones/unq.svg\" valign=\"middle\" alt=\"GitHub clones|unique per day|total\" /\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/traffic/clones/unq-14d.svg\" valign=\"middle\" alt=\"GitHub clones|unique per day|14d\" /\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://github.com/andry81-devops/gh-action--check-os-version/commits\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/metrics/commits-since-latest.svg\" valign=\"middle\" alt=\"GitHub commits since latest version\" /\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://github.com/andry81-devops/gh-action--check-os-version/releases\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/metrics/latest-release-name.svg\" valign=\"middle\" alt=\"latest release name\" /\u003e\u003c/a\u003e\r\n• \u003ca href=\"https://github.com/andry81-devops/gh-action--check-os-version/releases\"\u003e\r\n    \u003cimg src=\"https://github.com/andry81-cache/andry81-devops--gh-content-cache/raw/master/repo/andry81-devops/gh-action--check-os-version/badges/metrics/github-all-releases.svg\" valign=\"middle\" alt=\"GitHub all releases\" /\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://github.com/andry81/donate\"\u003e\u003cimg src=\"https://github.com/andry81-cache/gh-content-static-cache/raw/master/common/badges/donate/donate.svg\" valign=\"middle\" alt=\"donate\" /\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n---\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://github.com/andry81-devops/gh-action--check-os-version/tree/HEAD/userlog.md\"\u003eUserlog\u003c/a\u003e\r\n• \u003ca href=\"https://github.com/andry81-devops/gh-action--check-os-version/tree/HEAD/changelog.txt\"\u003eChangelog\u003c/a\u003e\r\n• \u003ca href=\"#known-issues\"\u003eKnown issues\u003c/a\u003e\r\n• \u003ca href=\"#copyright-and-license\"\u003e\u003cimg src=\"https://github.com/andry81-cache/gh-content-static-cache/raw/master/common/badges/license/mit-license.svg\" valign=\"middle\" alt=\"copyright and license\" /\u003e\u0026nbsp;Copyright and License\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003ch4 align=\"center\"\u003eGitHub composite action to check and read OS version details into variables.\u003c/h4\u003e\r\n\r\n\u003e [!WARNING]\r\n\u003e Currently implemented ONLY a Linux version details check.\r\n\r\nTutorial to use with: https://github.com/andry81-devops/github-action-extensions\r\n\r\nAll tutorials: https://github.com/andry81/index#tutorials\r\n\r\n##\r\n\r\n# gh-action--check-os-version@master\r\n\r\n**Features**:\r\n\r\n* Checks set of ways to read OS version details using input parameters:\r\n\r\n  * ```yml\r\n    gh-var-tags: runner-os\r\n    ```\r\n\r\n    \u003e ${{ runner.os }}\r\n\r\n  * ```yml\r\n    linux-files: /etc/os-release\r\n    ```\r\n\r\n    \u003e cat '/etc/os-release'\r\n\r\n  * ```yml\r\n    linux-commands: |\r\n      echo \"$ImageOS: $ImageVersion\"\r\n      lsb_release -a\r\n      hostnamectl\r\n      uname -r\r\n    ```\r\n\r\n    \u003e echo \"$ImageOS: $ImageVersion\"\r\n\r\n    \u003e lsb_release -a\r\n\r\n    \u003e hostnamectl\r\n\r\n    \u003e uname -r\r\n\r\n# USAGE\r\n\r\n## Example snippet:\r\n\r\n```yml\r\n  steps:\r\n    - name: check os version\r\n      id: check-os-version\r\n      uses: andry81-devops/gh-action--check-os-version@master\r\n      with:\r\n        gh-var-tags: runner-os\r\n        linux-files: /etc/os-release\r\n        linux-commands: |\r\n          echo \"$ImageOS: $ImageVersion\"\r\n          uname -r\r\n          lsb_release -a\r\n          hostnamectl\r\n\r\n    - name: read and decode return values\r\n      shell: bash\r\n      env:\r\n        check_os_version: ${{ steps.check-os-version.outputs.json-return-values }}\r\n      run: |\r\n        check_os_version=\"${check_os_version//$'\\t'/\\\\t}\"\r\n        check_os_version=\"${check_os_version//$'\\n'/\\\\n}\"\r\n        check_os_version=\"${check_os_version//$'\\r'/\\\\r}\"\r\n        echo \"check_os_version=$check_os_version\" \u003e\u003e \"$GITHUB_ENV\"\r\n        echo \"check_os_version=$check_os_version\"\r\n        echo \"JSON_RETURN_VALUES=$JSON_RETURN_VALUES\"\r\n\r\n    - name: print return values\r\n      shell: bash\r\n      run: |\r\n        check_os_version=\"$(echo -n \"$check_os_version\" | tr -d [:cntrl:])\"\r\n        \r\n        jq \u003c\u003c\u003c \"$check_os_version\"\r\n        \r\n        for key in $(jq -r \"keys|.[]\" \u003c\u003c\u003c \"$check_os_version\"); do\r\n          case \"$key\" in\r\n            gh-vars)\r\n              title_var=\"name\"\r\n              value_var=\"value\"\r\n              ;;\r\n            linux-files)\r\n              title_var=\"file\"\r\n              value_var=\"value\"\r\n              ;;\r\n            linux-commands)\r\n              title_var=\"line\"\r\n              value_var=\"out\"\r\n              ;;\r\n          esac\r\n        \r\n          for i in $(jq -r \".\\\"$key\\\"|keys|.[]\" \u003c\u003c\u003c \"$check_os_version\"); do\r\n            # suppress not zero exit code\r\n            IFS=$'\\n' read -r -d '' title value \u003c\u003c\u003c $(jq -r \".\\\"$key\\\"[$i].$title_var,.\\\"$key\\\"[$i].$value_var\" \u003c\u003c\u003c \"$check_os_version\") || (( 1 ))\r\n            value=\"${value//\\\\t/$'\\t'}\"\r\n            value=\"${value//\\\\n/$'\\n'}\"\r\n            value=\"${value//\\\\r/$'\\r'}\"\r\n            value=\"${value//\\\\\\\"/\\\"}\"\r\n            value=\"${value//\\\\\\\\/\\\\}\"\r\n            echo \"\u003e$title:\"$'\\n'\"$value\"$'\\n---'\r\n          done\r\n        done\r\n```\r\n\r\n---\r\n\r\n\u003e [!NOTE]\r\n\u003e See \u003ca href=\"https://github.com/andry81-devops/github-accum-stats#reuse\"\u003eREUSE\u003c/a\u003e section for details if you have multiple repositories and want to store all GitHub workflow scripts (`.github/workflows/*.yml`) in a single repository.\r\n\r\n## Known Issues\r\n\r\nhttps://github.com/andry81-devops/gh-known-issues#known-issues\r\n\r\n## Last known issues updates\r\n\r\nhttps://github.com/andry81-devops/gh-known-issues#last-known-issues-updates\r\n\r\n## Copyright and License\r\n\r\nCode and documentation copyright 2022 Andrey Dibrov. Code released under [MIT License](https://github.com/andry81-devops/gh-action--check-os-version/tree/HEAD/license.txt)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandry81-devops%2Fgh-action--check-os-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandry81-devops%2Fgh-action--check-os-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandry81-devops%2Fgh-action--check-os-version/lists"}