[BUG] Reusable workflows don't recognize Git references with slashes

Hi, while developing a reusable workflow I use experiments/composite-action branch for it. And from the other repository, I’m trying to use it following the syntax from the docs: uses: tox-dev/gh-action-tox/.github/workflows/call-tox.yml@experiments/composite-action.
This fails with

Invalid workflow file : .github/workflows/tox.yml#L1
handling usage of workflow "tox-dev/gh-action-tox/.github/workflows/call-tox.yml@experiments/composite-action": workflow is invalid: the `uses' attribute must be a path, a Docker image, or owner/repo@ref

I’ve tried changing the ref to main as an experiment and the error was different, it seems it actually attempted to fetch the specified file from that branch. This leads me to believe that there’s a bug in the validation of the Git references in the job-level uses:.

1 Like

Further investigation shows that renaming the branch to experimentscompositeaction does not help. So maybe it’s not a ref name but a workflow name? It contains a - after all.

No, changing - to _ doesn’t help either.

Alright… So the problem was in the referred workflow itself but it was absolutely unobvious from the error message. It’d better be improved.

I’ve faced a few issues with the workflow file being in other places than exactly under .github/workflows/, not deeper, not in the root, and also I had inputs: and secrets: placeholders without a value set (I suppose the YAML parser makes that null).

1 Like