| 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.Step.With
Description
This module provides the StepWith type for specifying input parameters
to GitHub Actions steps that use pre-built actions.
The with keyword allows you to pass inputs to actions, which can be:
* Environment variables for the action
* Docker container arguments (for Docker actions)
* Configuration parameters specific to the action
For more information about GitHub Actions step inputs, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith
Synopsis
- data StepWith
- = StepWithDockerArgs StepWithDockerArgsAttrs
- | StepWithEnv UnstructuredMap
- gen :: MonadGen m => m StepWith
Documentation
Input parameters for GitHub Actions steps.
Step inputs can be specified in two main ways:
StepWithDockerArgs- For Docker actions that need entry point and argumentsStepWithEnv- For actions that accept environment variables or general inputs
Most actions use the environment variable format, where inputs are passed as key-value pairs.
Example usage:
import Language.Github.Actions.Step.With
import qualified Data.Map as Map
-- Environment inputs for actions/checkout
checkoutInputs :: StepWith
checkoutInputs = StepWithEnv $ Map.fromList
[ ("repository", "owner/repo")
, ("ref", "main")
, ("token", "${{ secrets.GITHUB_TOKEN }}")
]
-- Docker action inputs
dockerInputs :: StepWith
dockerInputs = StepWithDockerArgs $ StepWithDockerArgsAttrs
{ entryPoint = "/entrypoint.sh"
, args = Just "arg1 arg2"
}
-- Action inputs for actions/upload-artifact
uploadInputs :: StepWith
uploadInputs = StepWithEnv $ Map.fromList
[ ("name", "build-artifacts")
, ("path", "dist/")
, ("retention-days", "30")
]
For more details, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith
Constructors
| StepWithDockerArgs StepWithDockerArgsAttrs | Docker action arguments |
| StepWithEnv UnstructuredMap | Environment variables/general inputs |
Instances
| FromJSON StepWith Source # | |
Defined in Language.Github.Actions.Step.With | |
| ToJSON StepWith Source # | |
| Generic StepWith Source # | |
| Show StepWith Source # | |
| Eq StepWith Source # | |
| Ord StepWith Source # | |
Defined in Language.Github.Actions.Step.With | |
| type Rep StepWith Source # | |
Defined in Language.Github.Actions.Step.With | |