{"record":{"id":"ee1aab3a23eb486f","repo":"nektos/act","slug":"uses-key-references-invalid-workflow-path-s","errorCode":null,"errorMessage":"`uses` key references invalid workflow path '%s'. Must start with './' if it's a local workflow, or must start with '<org>/<repo>/' and include an '@' if it's a remote workflow","messagePattern":"`uses` key references invalid workflow path '(.+?)'\\. Must start with '\\./' if it's a local workflow, or must start with '<org>/<repo>/' and include an '@' if it's a remote workflow","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/workflow.go","lineNumber":548,"sourceCode":"func (j *Job) Type() (JobType, error) {\n\tisReusable := j.Uses != \"\"\n\n\tif isReusable {\n\t\tisYaml, _ := regexp.MatchString(`\\.(ya?ml)(?:$|@)`, j.Uses)\n\n\t\tif isYaml {\n\t\t\tisLocalPath := strings.HasPrefix(j.Uses, \"./\")\n\t\t\tisRemotePath, _ := regexp.MatchString(`^[^.](.+?/){2,}.+\\.ya?ml@`, j.Uses)\n\t\t\thasVersion, _ := regexp.MatchString(`\\.ya?ml@`, j.Uses)\n\n\t\t\tif isLocalPath {\n\t\t\t\treturn JobTypeReusableWorkflowLocal, nil\n\t\t\t} else if isRemotePath && hasVersion {\n\t\t\t\treturn JobTypeReusableWorkflowRemote, nil\n\t\t\t}\n\t\t}\n\n\t\treturn JobTypeInvalid, fmt.Errorf(\"`uses` key references invalid workflow path '%s'. Must start with './' if it's a local workflow, or must start with '<org>/<repo>/' and include an '@' if it's a remote workflow\", j.Uses)\n\t}\n\n\treturn JobTypeDefault, nil\n}\n\n// ContainerSpec is the specification of the container to use for the job\ntype ContainerSpec struct {\n\tImage       string            `yaml:\"image\"`\n\tEnv         map[string]string `yaml:\"env\"`\n\tPorts       []string          `yaml:\"ports\"`\n\tVolumes     []string          `yaml:\"volumes\"`\n\tOptions     string            `yaml:\"options\"`\n\tCredentials map[string]string `yaml:\"credentials\"`\n\tEntrypoint  string\n\tArgs        string\n\tName        string\n\tReuse       bool\n}","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/model/workflow.go#L530-L566","documentation":"Job type detection rejects a `uses:` value that looks like a YAML path but is neither a local reusable workflow (must start with ./) nor a valid remote one (must match org/repo/path.yaml@ref). The regexes require at least two path segments after the org/repo prefix and a literal `@version` suffix.","triggerScenarios":"A job declares `uses: ./.github/workflows/deploy.yml` without @ref, `uses: org/repo/path.yml` missing @ref, `uses: org/repo` with .yml ext confusion, or `uses: ./other.yml` where detection ran because isYaml matched but the prefix rules failed.","commonSituations":"Forgetting the `@ref` (required even for local-style remote refs on GitHub); missing `./` prefix for local workflows; wrong number of path segments; assuming local workflows do not need a ref.","solutions":["Local reusable workflow: `uses: ./.github/workflows/name.yml` — keep the ./ prefix.","Remote reusable workflow: `uses: OWNER/REPO/.github/workflows/name.yml@v1` — include the full path and @ref.","Verify the referenced file exists at that path in the target repo/ref.","If the job is not meant to be reusable-workflow syntax, move the reference to a step-level `uses:` instead."],"exampleFix":"# before\njobs:\n  deploy:\n    uses: myorg/myrepo/.github/workflows/deploy.yml\n# after\njobs:\n  deploy:\n    uses: myorg/myrepo/.github/workflows/deploy.yml@v1","handlingStrategy":"type-guard","validationCode":"var remoteRe = regexp.MustCompile(`^[^.][^/]+/[^/]+/.+\\.ya?ml@.+$`)\nfunc validReusableUses(uses string) bool {\n    return strings.HasPrefix(uses, \"./\") || remoteRe.MatchString(uses)\n}","typeGuard":"func classifyUses(uses string) (local bool, remote bool) {\n    if strings.HasPrefix(uses, \"./\") {\n        return true, false\n    }\n    if remoteRe.MatchString(uses) { // org/repo/path.yml@ref\n        return false, true\n    }\n    return false, false\n}","tryCatchPattern":null,"preventionTips":["Always include @ref on remote reusable workflows; local ones must start with ./.","Validate `uses:` at job level with the regex above in workflow linting.","Confirm the target file exists in the referenced repo and ref."],"tags":["workflow","reusable-workflow","uses","validation"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}