Skip to main content

no-invalid-workflow-call-output-value

Rule catalog ID: R040

Targeted pattern scopeโ€‹

GitHub Actions workflow YAML files that define reusable workflow output values under on.workflow_call.outputs.*.value.

What this rule reportsโ€‹

This rule reports reusable workflow output values that:

  • reference contexts that are not available in on.workflow_call.outputs.*.value
  • fail to map from a job output such as jobs.build.outputs.artifact

Why this rule existsโ€‹

GitHub only allows the github, jobs, vars, and inputs contexts when computing reusable workflow output values, and those values must ultimately come from a job output inside the called workflow. Direct steps.*, needs.*, matrix.*, or literal-only mappings are invalid and break the reusable workflow contract.

โŒ Incorrectโ€‹

on:
workflow_call:
outputs:
deployment-url:
description: Published deployment URL
value: ${{ steps.publish.outputs.url }}

โœ… Correctโ€‹

on:
workflow_call:
outputs:
deployment-url:
description: Published deployment URL
value: ${{ jobs.deploy.outputs.deployment-url }}
jobs:
deploy:
runs-on: ubuntu-latest
outputs:
deployment-url: ${{ steps.publish.outputs.url }}
steps:
- id: publish
run: echo "url=https://example.com" >> "$GITHUB_OUTPUT"

Additional examplesโ€‹

For larger repositories, this rule is often enabled together with one of the published presets so violations are caught in pull requests before workflow changes are merged.

ESLint flat config exampleโ€‹

import githubActions from "eslint-plugin-github-actions-2";

export default [
{
files: ["**/*.{yml,yaml}"],
plugins: {
"github-actions": githubActions,
},
rules: {
"github-actions/no-invalid-workflow-call-output-value": "error",
},
},
];

When not to use itโ€‹

You can disable this rule when its policy does not match your repository standards, or when equivalent enforcement is already handled by another policy tool.

Further readingโ€‹