Skip to content

A GitHub Action to install the GitHub CLI (gh) on self-hosted runners with support for multiple platforms and architectures.

License

Notifications You must be signed in to change notification settings

v2d27/setup-gh-cli

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup GitHub CLI Action

GitHub Super-Linter CI Check dist/ CodeQL Coverage

A GitHub Action to install the GitHub CLI (gh) on self-hosted runners with support for multiple platforms and architectures.

Features

  • Multi-platform support: Linux, macOS, and Windows
  • Multi-architecture support: amd64, arm64, and 386 (32-bit)
  • Automatic archive format detection: tar.gz for Unix-like systems, ZIP for Windows
  • Tool caching: Avoids re-downloading if the same version is already cached
  • Version flexibility: Install latest version or specify a custom version
  • Platform detection: Automatically detects the runner's platform and architecture

Supported Platforms and Architectures

Platform amd64 arm64 386
Linux
macOS
Windows

Usage

Basic Usage

steps:
  - name: Setup GitHub CLI
    uses: v2d27/[email protected]

Advanced Usage

steps:
  - name: Setup GitHub CLI
    uses: v2d27/[email protected]
    with:
      version: 'latest' # Optional: specify GitHub CLI version (default: latest)

Development

Environment Setup

  • Install dependencies:
npm install
  • Make sure you have Node.js 20.x or later installed

Building

Package the TypeScript for distribution:

npm run bundle

Testing

Run the test suite:

npm test

Linting

Run ESLint to check for code issues:

npm run lint

Project Structure

  • src/ - TypeScript source code
    • main.ts - Main action logic with multi-platform support
    • index.ts - Entry point
  • __tests__/ - Unit tests
  • dist/ - Generated JavaScript (do not edit manually)
  • action.yml - Action metadata and input/output definitions

Contributing

Please make pull request to this source code at: https://github.com/v2d27/setup-gh-cli

About

A GitHub Action to install the GitHub CLI (gh) on self-hosted runners with support for multiple platforms and architectures.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •