Skip to content

clarify needs context contains outputs from all jobs that are defined as a dependency of the current job #20701

@jsoref

Description

@jsoref

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context

What part(s) of the article would you like to see updated?

The needs context contains outputs from all jobs that are defined as a dependency of the current job. For more information on defining job dependencies, see "Workflow syntax for GitHub Actions."

Additional information

As noted in https://github.com/commercialhaskell/stack/pull/5869/files#r973830586, it's unclear whether the prose here means "only outputs for jobs that are explicitly defined as dependent on this job will have their information available via needs" or "needs will have access to the status of any jobs defined in a cascading manner as blocking this job".

Assuming it means the former, the fix would be something like:

The needs context contains outputs from all jobs that are explicitly defined in the current job as a dependency of the current job using the needs property. Note that this doesn't include implicitly needed jobs. For more information on defining job dependencies, see "Workflow syntax for GitHub Actions."

This does appear to correspond to the output here: https://github.com/jsoref/cascading-needs/actions/runs/3079668494/jobs/4976170085

If it means the latter,

The needs context contains outputs from all jobs that defined in the current job or any jobs it transitively needs via the needs property. For more information on defining job dependencies, see "Workflow syntax for GitHub Actions."

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions