| Copyright | (c) 2025 Bellroy Pty Ltd |
|---|---|
| License | BSD-3-Clause |
| Maintainer | Bellroy Tech Team <haskell@bellroy.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.Github.Actions.RunIf
Description
This module provides the RunIf type for representing conditional expressions
in GitHub Actions workflows. GitHub Actions allows both boolean and string
expressions in 'if' conditions for jobs and steps.
Examples of valid 'if' conditions:
* if: false - Boolean
* if: "github.ref == 'refsheadsmain'" - String
For more information about GitHub Actions conditional expressions, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idif
Documentation
A conditional expression that can be either a boolean or string.
GitHub Actions supports flexible 'if' conditions:
RunIfBool- Simple boolean values liketrueorfalseRunIfString- GitHub expressions like"github.ref == 'refsheadsmain'"
Examples:
-- Simple boolean condition simpleFalse :: RunIf simpleFalse = RunIfBool False -- GitHub expression condition branchCheck :: RunIf branchCheck = RunIfString "github.ref == 'refsheadsmain'"
The type preserves the original format during round-trip serialization, so a boolean input remains a boolean in the output YAML.
Constructors
| RunIfBool Bool | |
| RunIfString Text |