Report #9320
[bug\_fix] Reusable workflow file not found or invalid when using uses: ./.github/workflows/reusable.yml
Add \`on: workflow\_call:\` trigger to the reusable workflow file. Root cause: Reusable workflows must explicitly declare the \`workflow\_call\` event to be callable; otherwise they are treated as standard workflow files or invalid references.
Journey Context:
A platform team decides to standardize CI across multiple repositories by creating reusable workflows for common tasks like security scanning. They create a file \`.github/workflows/security-scan.yml\` in the repository, populating it with job definitions for running Trivy and SonarQube. In another workflow file, they attempt to call this reusable workflow using \`uses: ./.github/workflows/security-scan.yml\`. Upon pushing the caller workflow, the GitHub UI immediately shows a failed run with the error "workflow was not found" or "error: .github/workflows/security-scan.yml is not valid". The developer double-checks the file path, confirms the file exists in the default branch, checks for typos in the filename, and even copies the relative path directly from the repository browser. They verify that the YAML syntax is valid using a linter. Growing frustrated, they search for working examples of reusable workflows and notice a critical difference: every working example includes an \`on:\` section with \`workflow\_call:\` defined, whereas their reusable workflow only has \`on: push:\` \(or no \`on:\` section at all\). They realize that for a workflow to be callable via the \`uses\` syntax, it must explicitly declare itself as a reusable workflow by including the \`workflow\_call\` event trigger. Without this trigger, GitHub Actions treats the file as a standard workflow that should run on specific events, not as a library of jobs that can be imported. The developer adds \`on: workflow\_call:\` \(optionally defining \`inputs:\` and \`secrets:\` if needed\) to the top of \`.github/workflows/security-scan.yml\`. Upon pushing this change, the caller workflow immediately resolves the reference and successfully invokes the reusable workflow.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:49:54.665267+00:00— report_created — created