You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local composite actions always relative to top level repository #1348
I'm building a set of actions for my organization, and I would like to re-use common sections as composite actions. This appears to be the motivating case around #646, and it certainly suits my needs.
However: I have a pattern like:
main repo
- uses: actions/checkout@v2-beta # check out your code
- uses: actions/checkout@v2-beta # check out the actions repo
with:
repository: my-org/github-actions
ref: refs/tags/v1
path: github-actions
- name: Run the private action
uses: ./github-actions/build-em-all
then in my-org/github-actions/build-em-all/action.yml
#...
- uses: ./do-tedious-setup
My dilemma here is that the above won't work - the action is looked up relative the the consumer's workspace; so it should be - uses: ./github-actions/do-tedious-setup - but that's entirely dependent on the checkout in the consumer! The actions library has to expect that it's checked out in the right directory, which itself imposes a restriction on the file structure of consuming projects.
Even if I were to parameterize the checkout location, the uses field (probably rightfully) doesn't get any contexts to work from, so I can't deliver the input.
For the moment, I'm settling on documenting the requirement and hoping it doesn't cause a problem.
Expected behavior
It'd be great if actions were looked up with a Bash style PATH behavior and that a workflow could append items to the lookup list.
Runner Version and Platform
Version of your runner? Github hosted ubuntu-latest
Reacted by Miloš Lajtman, ChristopherHX, William Bartee, Zdenek Farana, Emilien Escalle, arnomijs, Niklas Radomski, Julien Bonastre, Peter Leibiger and Ben
Hey @nyarly , we expose a variable in the github context ${{github.action_path}} that contains the path to where the action is located. You can use that in relation to your subpath to accomplish what you are trying to do if i'm understanding your use case correctly, can you try that?
We don't support these contexts in a uses statement, which appears to be the issue here. We could support these contexts, which would allow you to do something like uses: ${{github.action_path}}/do-tedious-setup which would help this use case, but I don't think we have a dynamic way of doing this outside of your suggested workaround right now. Thanks for reporting this.
Reacted by Judson Lester, ChristopherHX, Randy Lai, Florian, Riccardo Capraro, William Bartee and MikeM
I want to share common Github Actions in my org. For composite actions that use other tasks with a relative path, this breaks because it will look for the task in the consuming repository and not where the shared action is stored. I would consider this a bug.
Yes, when loading e.g. myaction@main, scripts called by action.yml e.g. src/myscript.py are not found during the job run.
Only scripts that are in the exact same folder side-by-side with action.yml are loaded by the job.
We've been working on a solution for this. We're proposing a new $/ syntax that lets composite actions reference sibling actions in the same repo at the same SHA. No checkout required, no hardcoded refs.
I've posted the full proposal with examples over in community#26245. We'd love your feedback there!
Activity
thboop commentedon Sep 16, 2021
Hey @nyarly ,
we expose a variable in the github context${{github.action_path}}that contains the path to where the action is located. You can use that in relation to your subpath to accomplish what you are trying to do if i'm understanding your use case correctly, can you try that?There are some more docs located hereWe don't support these contexts in a
usesstatement, which appears to be the issue here. We could support these contexts, which would allow you to do something likeuses: ${{github.action_path}}/do-tedious-setupwhich would help this use case, but I don't think we have a dynamic way of doing this outside of your suggested workaround right now. Thanks for reporting this.ricCap commentedon Feb 13, 2022
@thboop when you find the time, could you please have a look at #1684?
@nyarly, does #1684 covers your use case?
Thanks both
Waterstraal commentedon Feb 20, 2025
Running into this exact same issue right now.
I want to share common Github Actions in my org. For composite actions that use other tasks with a relative path, this breaks because it will look for the task in the consuming repository and not where the shared action is stored. I would consider this a bug.
Can this be fixed on Github's side @thboop?
frednntelia commentedon Apr 28, 2025
Yes, when loading e.g.
myaction@main, scripts called byaction.ymle.g.src/myscript.pyare not found during the job run.Only scripts that are in the exact same folder side-by-side with
action.ymlare loaded by the job.I wonder why this is not documented anywhere.
ericsciple commentedon Jan 26, 2026
Hi everyone 👋
We've been working on a solution for this. We're proposing a new
$/syntax that lets composite actions reference sibling actions in the same repo at the same SHA. No checkout required, no hardcoded refs.I've posted the full proposal with examples over in community#26245. We'd love your feedback there!
— The GitHub Actions Team
fix: inline setup action to resolve remote composite action path issue
fix: inline setup action to resolve remote composite action path issue (
refactor(ci): share pull-registry-image via a script instead of inlining
fix(ci): make ksail-cluster's registry-image pull work for external c…
fix(ci): bump ksail-cluster action pin to v7.33.0 to fix external-con…
build-jupyter-cache/publish: pin siblings, scope artifact, harden rel…
refactor(unity): batch-mode の version 取得を project-version action に委譲
feat(unity): add project-version / product-name / batch-mode composit…
refactor(dotnet-setup): resolve .NET fallback SDK version from global…
fix(action): check-target nested uses: resolution + effective-depth s…
Fix nested uses: path bug in generate-altdoc-* composites
Add altdoc-multiversion-docs: port rpt's multiversion docs pattern (#284
memories: nested composite uses: ./... resolves against consumer's wo…
feat(local): follow uses: ./path into the file it names
feat: add setup-bun, setup-rust, r2-upload and github-release actions (…
feat(workflows): add the checks reusable and dogfood it (#551)
tear the peer down when the job ends
tear the peer down when the job ends
feat(action): add a root action.yml so the short `uses:` form resolves
feat: the setup action
feat: the setup action
feat: add a `checkout` input
feat: add a `checkout` input