Skip to content

api_function_testgithubactionsenvironment

hugoalh edited this page Nov 20, 2023 · 11 revisions

Test-GitHubActionsEnvironment

  • Type: Function
  • In Version: >= v0.3.0

Test the current process whether is executing inside the GitHub Actions environment.

  • # >= v2.0.0; Parameter Set: Mandatory
    Test-GitHubActionsEnvironment
      [-Artifact]
      [-Cache]
      [-OpenIdConnect]
      [-ToolCache]
      -Mandatory
      [-MandatoryMessage <String>]
  • # >= v2.0.0; Parameter Set: Optional (Default)
    Test-GitHubActionsEnvironment
      [-Artifact]
      [-Cache]
      [-OpenIdConnect]
      [-ToolCache]
  • # < v2.0.0
    Test-GitHubActionsEnvironment
      [-Artifact]
      [-Cache]
      [-OpenIdConnect]
      [-ToolCache]
      [-Mandatory]
      [-MandatoryMessage <String>]

Parameter

Artifact

[Optional] <Switch> Also test whether have artifact resources.

  • Parameter Set: (>= v2.0.0)
    • Optional
    • Mandatory
  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌

Cache

[Optional] <Switch> Also test whether have cache resources.

  • Parameter Set: (>= v2.0.0)
    • Optional
    • Mandatory
  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌

Mandatory

  • (>= v2.0.0) <Switch> Whether the requirement is mandatory; If mandatory but not fulfill, will throw an error (PowerShell error).
  • (< v2.0.0) [Optional] <Switch> Whether the requirement is mandatory; If mandatory but not fulfill, will throw an error (PowerShell error).

β€’

  • Parameter Set: (>= v2.0.0) Mandatory
  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌
  • Alias:
    • Require
    • Required

MandatoryMessage

[Optional] <String> Message when the requirement is mandatory but not fulfill.

  • Parameter Set: (>= v2.0.0) Mandatory
  • Default Value:
    'This process requires to invoke inside the GitHub Actions environment!'
  • Position: Named
  • Accept Pipeline Input: False ❌
  • Accept Pipeline Input By Property Name: False ❌
  • Accept Wildcard Characters: False ❌
  • Alias:
    • RequiredMessage
    • RequireMessage

OpenIdConnect

[Optional] <Switch> Also test whether have OpenID Connect (OIDC) resources.

  • Parameter Set: (>= v2.0.0)
    • Optional
    • Mandatory
  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌
  • Alias:
    • Oidc

ToolCache

[Optional] <Switch> Also test whether have tool cache resources.

  • Parameter Set: (>= v2.0.0)
    • Optional
    • Mandatory
  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌

Output

  • Mandatory: <Void>
  • Optional: <Boolean> Test result.

Guide

API

Enum

Enum Flag

Function

Function Alias

Clone this wiki locally