Skip to content

Misleading section "Example: Using an action inside a different private repository than the workflow" in "Workflow Syntax" #34562

Closed

Description

@cfstras

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow

What part(s) of the article would you like to see updated?

The current example explains you must checkout the private repository and reference the action locally, which also necessitates setting up private access tokens as secrets.

However, after following Allowing access to components in an internal repository, the regular uses: {owner}/{repo}/{path}@{ref} seems to work just fine.
This is misleading and should be added as an example, or explained why this easier approach should not be used.

Additional information

No response

Activity

  1. added
    contentThis issue or pull request belongs to the Docs Content team
    on Sep 11, 2024
  2. welcome commented on Sep 11, 2024

    @welcome

    Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

  3. added
    triageDo not begin working on this issue until triaged by the team
    on Sep 11, 2024
  4. added
    actionsThis issue or pull request should be reviewed by the docs actions team
    waiting for reviewIssue/PR is waiting for a writer's review
    and removed
    triageDo not begin working on this issue until triaged by the team
    on Sep 11, 2024
  5. nguyenalex836 commented on Sep 11, 2024

    @nguyenalex836
    Contributor

    @cfstras Thank you for raising this issue! I'll get this triaged for review ✨ Our team will provide feedback regarding the best next steps for this issue - thanks for your patience! 💛

  6. added
    needs SMEThis proposal needs review from a subject matter expert
    on Sep 17, 2024
  7. github-actions commented on Sep 17, 2024

    @github-actions
    Contributor

    Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀

  8. janbrasna commented on Sep 20, 2024

    @janbrasna
    Contributor

    Just a note — the article in question is about dotcom/FPT private repos, while the linked solution is GHE internal repo — which is not the same. Just in case it makes a difference in OP's case.

  9. cfstras commented on Sep 20, 2024

    @cfstras
    Author

    Hi Jan, thanks for the clarification!
    I had assumed we were still on a Pro/private plan, but you're right we have switched to GHE/internal repos.
    It seems though that the same misleading section is present in the Enterprise Cloud variant of the docs page, and it doesn't make the distinction between private and internal repos:
    https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow

    Might be a good note to add, I wasn't aware that the difference between internal and private repos are of relevance here.

  10. janbrasna commented on Sep 23, 2024

    @janbrasna
    Contributor

    (Disclaimer: I'm not familiar with the particular rules for API/token access across internal repos inside the same org per se — I'm only leaving notes for the subject matter expert in triage to point to the slight difference of the OP description compared to the real issue.)

    @cfstras Even for GHE version, the linked content is still right;) The real issue is that the distinction between private and internal repos is not pointed out there.

    "Using an action inside a different private repository than the workflow" should be read as "Using an action from a different private repository" — i.e. only if the repository containing the intended action is private (!=internal). If the reusable action is in public, or internal (=visible to all in the org), then it doesn't matter what's the visibility of the repo referencing it.

    publicA action can be used in publicB, privateX or internalN (save for some org policy allowing action sources etc.); internalA action can be used by all internalX or privateY from the same org (not sure about public repos from the same org tho) — only private (and perhaps internal when referenced from outside the org) need the explicit access mentioned in the article.

  11. janbrasna commented on Sep 23, 2024

    @janbrasna
    Contributor

    @cfstras Nope, sorry, now I see what you refer to. Indeed the "manual checkout" description is only useful when the private repository you need to reference is outside of your org/enterprise. For repos under the same owner, there's just the preference as you point out.

    So basically for GHE, the FPT-centric wording is not enough — and should be expanded to cover the difference between same-owner (i.e. this config only needed) and out-of-enterprise private repos.

  12. cfstras commented on Sep 23, 2024

    @cfstras
    Author

    Right, sorry, I'm coming completely from the "internal open-source" mindset here.

    For our setup, the docs essentially sent me on a wild goose chase setting up PATs and using actions/checkout twice, when I should have just tried uses: my-org/other-repo/.github/actions/shared-action@main.

  13. joshmgross commented on Oct 3, 2024

    @joshmgross
    Contributor

    👋 Hello from Actions Engineering,

    I agree this example in the docs is misleading, as it implies that it's the only way to use an action in a different private repository. This docs example predates Actions supporting private and internal actions as built-in feature.

    We should update this section to point to the corresponding docs on using private and internal actions.

    I see some value in keeping this example though - for example you can't use a private action from an internal or public repository, nor can you use it from a repository in a separate Enterprise account.

  14. 9 remaining items

  15. added
    staleThere is no recent activity on this issue or pull request
    on Feb 19, 2025
  16. added
    triageDo not begin working on this issue until triaged by the team
    on Feb 27, 2025
  17. removed
    triageDo not begin working on this issue until triaged by the team
    staleThere is no recent activity on this issue or pull request
    on Feb 27, 2025
  18. added
    staleThere is no recent activity on this issue or pull request
    on May 5, 2025
  19. jsoref commented on May 12, 2025

    @jsoref
    Contributor
  20. added
    triageDo not begin working on this issue until triaged by the team
    on May 12, 2025
  21. removed
    triageDo not begin working on this issue until triaged by the team
    staleThere is no recent activity on this issue or pull request
    on May 12, 2025
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

    SME reviewedAn SME has reviewed this issue/PRactionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issuenever-staleDo not close as stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions