Report #51758
[bug\_fix] Reusable workflow not found or invalid ref format when calling reusable workflows
Use the correct syntax: for local reusable workflows in the same repo, use \`uses: ./.github/workflows/reusable.yml\` \(note the leading \`./\`\). For remote reusable workflows, use \`uses: owner/repo/.github/workflows/reusable.yml@ref\` where \`@ref\` is a specific commit SHA, tag, or branch name \(e.g., \`@main\` or \`@v1\`\). The root cause is that reusable workflows require an explicit reference and path format; omitting the \`./\` for local workflows or the \`@ref\` for remote workflows causes the parser to fail to locate the file.
Journey Context:
Developer decides to modularize their CI by converting a build job into a reusable workflow called \`build.yml\`. They create the file in \`.github/workflows/build.yml\` with the \`workflow\_call\` trigger. In their main workflow \`ci.yml\`, they attempt to call it by writing \`uses: .github/workflows/build.yml\`. Upon pushing, they immediately receive a workflow validation error: \`error parsing called workflow: ".github/workflows/build.yml": workflow was not found\`. Developer double-checks the filename and path, confirming the file exists. They try removing the leading dot, using \`uses: github/workflows/build.yml\`, which fails with the same error. They search for examples of reusable workflows and notice that all examples use \`./\` prefix for local workflows. They update the line to \`uses: ./.github/workflows/build.yml\` and the validation passes. Later, they try to reference a reusable workflow from a different repository \(\`myorg/shared-workflows\`\), writing \`uses: myorg/shared-workflows/.github/workflows/build.yml\`. This fails with \`invalid ref format\`. They realize they need to specify a git ref \(branch, tag, or SHA\). They append \`@main\` to the end, making it \`uses: myorg/shared-workflows/.github/workflows/build.yml@main\`, which successfully resolves and runs the remote reusable workflow.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:22:08.047592+00:00— report_created — created