github-actions-0.1.1.0: Github Actions
Copyright(c) 2025 Bellroy Pty Ltd
LicenseBSD-3-Clause
MaintainerBellroy Tech Team <haskell@bellroy.com>
Safe HaskellNone
LanguageHaskell2010

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

Synopsis

Documentation

data RunIf Source #

A conditional expression that can be either a boolean or string.

GitHub Actions supports flexible 'if' conditions:

  • RunIfBool - Simple boolean values like true or false
  • RunIfString - 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.

Instances

Instances details
FromJSON RunIf Source # 
Instance details

Defined in Language.Github.Actions.RunIf

ToJSON RunIf Source # 
Instance details

Defined in Language.Github.Actions.RunIf

Generic RunIf Source # 
Instance details

Defined in Language.Github.Actions.RunIf

Associated Types

type Rep RunIf 
Instance details

Defined in Language.Github.Actions.RunIf

type Rep RunIf = D1 ('MetaData "RunIf" "Language.Github.Actions.RunIf" "github-actions-0.1.1.0-BjHhRMO6iQ17qdsNXwhDab" 'False) (C1 ('MetaCons "RunIfBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: C1 ('MetaCons "RunIfString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: RunIf -> Rep RunIf x #

to :: Rep RunIf x -> RunIf #

Show RunIf Source # 
Instance details

Defined in Language.Github.Actions.RunIf

Methods

showsPrec :: Int -> RunIf -> ShowS #

show :: RunIf -> String #

showList :: [RunIf] -> ShowS #

Eq RunIf Source # 
Instance details

Defined in Language.Github.Actions.RunIf

Methods

(==) :: RunIf -> RunIf -> Bool #

(/=) :: RunIf -> RunIf -> Bool #

Ord RunIf Source # 
Instance details

Defined in Language.Github.Actions.RunIf

Methods

compare :: RunIf -> RunIf -> Ordering #

(<) :: RunIf -> RunIf -> Bool #

(<=) :: RunIf -> RunIf -> Bool #

(>) :: RunIf -> RunIf -> Bool #

(>=) :: RunIf -> RunIf -> Bool #

max :: RunIf -> RunIf -> RunIf #

min :: RunIf -> RunIf -> RunIf #

type Rep RunIf Source # 
Instance details

Defined in Language.Github.Actions.RunIf

type Rep RunIf = D1 ('MetaData "RunIf" "Language.Github.Actions.RunIf" "github-actions-0.1.1.0-BjHhRMO6iQ17qdsNXwhDab" 'False) (C1 ('MetaCons "RunIfBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: C1 ('MetaCons "RunIfString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))