Skip to content

Improve usability when nesting composite actions in a monorepository #2101

Closed

Description

@flobernd

Describe the enhancement

Using an action from the same repository inside a composite action is very inconvenient at the moment. Imagine the following directory structure:

root
 :. actions
 :   :. a
 :   :. b

If we use action b as a step of action a, we are very limited in a way that we have to choose one of the following options:

Use the repository syntax

- uses: user/repo/actions/b@ref

This is extremely bad for maintainability as we always have to hardcode a specific ref in the caller action. When bumping the version from v1 -> v2 we have to change this part in all places. We as well can not simply use master as this would break the action for everybody who pinned it to a specific tag. It's even worse if the caller pinned the action to a specific commit hash.

Copy to $GITHUB_WORKSPACE

When referencing an action using a relative path, the path is always relative to $GITHUB_WORKSPACE.

- run: cp -r ${{ github.action_path }} ${{ github.workspace }}/.actions
- uses: ./.actions/b

While this works perfectly fine and we as well make sure that the same ref is used for a and b, it still adds boilerplate code to the action and as well could cause problems, if the checked out repository already contains a .actions directory. Besides that, we have to pay extra attention to always copy when using different refs like user/repo/actions/a@v1 for one step and user/repo/actions/a@v2 for another one (even tho that's an unlikely to happen scenario).

Proposed solution

Allow actions to be referenced using pathes relative to the action repository. To remain backwards compatibility, a syntax like this could be implemented:

- uses: $ACTION_ROOT/actions/b

where $ACTION_ROOT points to the root directory of the repository that contains action.

- uses: $ACTION_PATH/../b

where $ACTION_PATH points to the directory that contains the current action (alias for github.action_path).

Activity

  1. added
    enhancement
    on Sep 3, 2022
  2. added
    Service Feature
    on Oct 3, 2022
  3. nikola-jokic commented on Oct 3, 2022

    @nikola-jokic
    Contributor

    Hey @flobernd,

    Sorry for the late response. Thank you for submitting this issue! Since it is related more to the platform more generally, could you please post your feedback on the GitHub Feedback site, which is actively monitored. Using the forum ensures that we route your feature to the correct team ☺️ I will leave this issue here with the Service Feature label.

  4. nikola-jokic commented on Mar 22, 2023

    @nikola-jokic
    Contributor

    Closed this one due to new contribution guidelines.

  5. ericsciple commented on Jan 26, 2026

    @ericsciple
    Collaborator

    Hi @flobernd 👋

    We've been working on a solution very similar to what was proposed here. We're introducing a new $/ syntax (similar to the $ACTION_ROOT idea):

    # In actions/a/action.yml
    - uses: $/actions/b   # same repo, same SHA

    When someone uses user/repo/actions/a@v2, the $/actions/b automatically resolves to user/repo/actions/b@v2. No hardcoding, no version drift, no workspace copying.

    I've posted the full proposal over in community#26245. We'd love your feedback there!

    — The GitHub Actions Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Service Featureenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions