| 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.Job.Needs
Description
This module provides the JobNeeds type for representing job dependencies
in GitHub Actions workflows. GitHub Actions allows both strings and
lists of strings for the needs field.
Examples of valid needs specifications:
* needs: build - Single job specified as a string
* needs: [build] - Single job specified as a list of strings
* needs: [build, test] - Multiple job dependencies specified as a list of strings
For more information about GitHub Actions job dependencies, see: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds
Documentation
Job dependency specification that preserves YAML representation.
GitHub Actions supports flexible job dependency specification:
JobNeedsString- Single job dependency as string likeneeds: buildJobNeedsArray- Multiple job dependencies as array likeneeds: [build, test]
Examples:
-- Single job dependency (string form) stringDep :: JobNeeds stringDep = JobNeedsString (JobId "build") -- Multiple job dependencies (array form) arrayDeps :: JobNeeds arrayDeps = JobNeedsArray (JobId "build" :| [JobId "test", JobId "lint"])
The type preserves the original YAML format during round-trip serialization. A string input will serialize back to a string, and an array input will serialize back to an array, preventing information loss.
Constructors
| JobNeedsString JobId | |
| JobNeedsArray (NonEmpty JobId) |