hugoalh-studio / setup-powershell-toolkit-ghaction

A GitHub Action to setup PowerShell module `hugoalh.GitHubActionsToolkit`.

Home Page:https://github.com/marketplace/actions/setup-powershell-toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup PowerShell Toolkit (GitHub Action)

βš–οΈ MIT

πŸ—‚οΈ GitHub: hugoalh-studio/setup-powershell-toolkit-ghaction

πŸ†™ Latest Release Version (Latest Release Date)

A GitHub Action to setup PowerShell module hugoalh.GitHubActionsToolkit (GitHub)(PowerShell Gallery).

Important

This documentation is v2.0.0 based; To view other version's documentation, please visit the versions list and select the correct version.

🎯 Target

  • GitHub Actions Runner

    πŸ›‘οΈ Require Permission

    N/A

    πŸ’½ Require Software

    • PowerShell >= v7.2.0

πŸ”° Usage

Composite Action

  1. Import at the metadata (action.yml):
    runs:
      using: "composite"
      steps:
        - uses: "hugoalh-studio/setup-powershell-toolkit-ghaction@<Tag>"

Workflow

  1. Import at the workflow (.github/workflows/<WorkflowName>.yml):
    jobs:
      job_id:
        runs-on: "________" # Any
        steps:
          - uses: "hugoalh-studio/setup-powershell-toolkit-ghaction@<Tag>"

🧩 Input

Note

All of the inputs are optional; Use this action without any input will default to install major equitant latest version of 2.1.0 for current user, and keep the setting that modified.

sudo

<Boolean = False> Whether to execute in sudo mode on non-Windows environment. This must set to True in order to able install for all users on non-Windows environment (i.e.: when input scope is "AllUsers").

version

<String = "^2.1.0"> Target version, by Semantic Versioning (SemVer) 2.0.0 with optional modifier; Default to major equitant latest version of 2.1.0.

  • "Latest": Latest version
  • "<1.2.3": Less than this version
  • "<=1.2.3": Less than or equal to this version
  • "1.2.3" / "=1.2.3": Equal to this version
  • ">=1.2.3": Greater than or equal to this version
  • ">1.2.3": Greater than this version
  • "^1.2.3": Between this version and major equitant latest version
  • "~1.2.3": Between this version and minor equitant latest version

allowprerelease

<Boolean = False> Whether to allow target pre release version.

scope

<String = "CurrentUser"> Installation scope.

  • "AllUsers": For all users. Also need to set input sudo to True on non-Windows environment.
  • "CurrentUser": For current user.

force

<Boolean = False> Whether to force install or reinstall target (pre release) version.

keepsetting

<Boolean = False> Whether to keep the setting that modified.

🧩 Output

path

<String> Path of the installation.

version

<SemVer> Version of the installation.

✍️ Example

  • jobs:
      job_id:
        name: "Hello World"
        runs-on: "ubuntu-latest"
        steps:
          - name: "Setup PowerShell Toolkit"
            uses: "hugoalh-studio/setup-powershell-toolkit-ghaction@v2.0.0"
          - run: |
              Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local'
              Write-GitHubActionsNotice -Message 'Hello, world!'
            shell: "pwsh"

πŸ“š Guide

About

A GitHub Action to setup PowerShell module `hugoalh.GitHubActionsToolkit`.

https://github.com/marketplace/actions/setup-powershell-toolkit

License:Other


Languages

Language:PowerShell 100.0%