A consuming team references an organisation reusable workflow stored at octo-org/automation in the file .github/workflows/build.yml, but their calling job fails to resolve the workflow. They are calling it with uses from another repository in the organisation. Which uses value references a reusable workflow held in a separate repository correctly?
jobs:
call-build:
uses: <reference>- Auses: octo-org/automation@v1, naming only the owner and repository with a git ref, on the basis that GitHub locates the single reusable workflow file inside that repository automatically.
- Buses: ./.github/workflows/build.yml@v1, using a path relative to the caller with a git ref, on the basis that the leading dot-slash points GitHub at the shared workflow in the other repository.
- Cuses: octo-org/automation/.github/workflows/build.yml@v1, giving the owner, repository, full path to the workflow file under .github/workflows, and a git ref after the at sign. Correct
- Duses: octo-org/automation/build.yml@v1, naming the owner, repository, and workflow file name with a git ref, omitting the .github/workflows segment because GitHub assumes that directory by default.
Why A is wrong: Tempting because action references stop at owner and repository, but a reusable workflow reference must include the full path to the specific YAML file under .github/workflows, so this resolves nothing.
Why B is wrong: Tempting because a leading dot-slash does call a reusable workflow in the same repository, but it cannot reach another repository and a local reference must not carry a git ref after the path.
Why C is correct: Calling a reusable workflow in another repository requires the owner and repository, the full path to the file under .github/workflows, and a git ref after the at sign, which this reference supplies exactly.
Why D is wrong: Tempting because the .github/workflows location feels implied, but a cross-repository reusable workflow reference must spell out the full .github/workflows path, so dropping that segment fails to resolve.