Skip to content

api_function_testgithubactionsenvironment

hugoalh edited this page Sep 23, 2023 · 11 revisions

Test-GitHubActionsEnvironment

⚠️ Important: Do not confused with function Test-GitHubActionsNodeJsEnvironment!

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

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

  • Test-GitHubActionsEnvironment
      [-Artifact]
      [-Cache]
      [-OpenIdConnect]
      [-ToolCache]
      [-Mandatory]
      [-MandatoryMessage <String>]

Parameter

Artifact

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

  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌

Cache

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

  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌

Mandatory

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

  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌
  • Alias:
    • Require
    • Required

MandatoryMessage

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

  • 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.

  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌
  • Alias:
    • Oidc

ToolCache

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

  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌

StepSummary

❌ Removed: This is officially removed, will throw error in the latest version.

(< v1.4.0) [Optional] <Switch> Also test whether have step summary resources.

  • Position: Named
  • Accept Pipeline Input By Property Name: False ❌

Output

  • <Boolean> Test result when the requirement is not mandatory.
  • <Void> Nothing when the requirement is mandatory.

Guide

API

Enum

Enum Flag

Function

Function Alias

Clone this wiki locally