Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: using a GitHub Action from another private repository #95

Closed
francisfuzz opened this issue Dec 4, 2019 · 26 comments
Closed

Docs: using a GitHub Action from another private repository #95

francisfuzz opened this issue Dec 4, 2019 · 26 comments
Assignees

Comments

@francisfuzz
Copy link

I think it would be great to update our README to showcase how to use a GitHub Action from another private repository.

As of actions/checkout@v2-beta, it is possible to checkout a different private repository:

https://github.com/actions/checkout#checkout-a-different-private-repository

If the just-cloned private repository is a Docker container action containing a Dockerfile, action metadata file, and entrypoint, it's possible to run it since uses syntax supports citing actions in the same repository as the workflow:

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-using-action-in-the-same-repository-as-the-workflow

Example:

name: CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2-beta
      with:
        # Private version of https://github.com/actions/hello-world-docker-action
        repository: USER/private-hello-world-docker-action
        ref: refs/tags/v1
        token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains your PAT to clone that private repo
    - name: Run the private action
      uses: ./
      with:
        who-to-greet: "Mona the Octocat"

If the team is open to getting this documented, I'm happy to cut a PR. ✌️

@ericsciple
Copy link
Contributor

@chrispat for thoughts.

This is very interesting.

Would this page on help.github.com would be a better place to document the product scenario? This repo is just about the checkout action.

Do we have an ETA for first class support for private-actions?

Although the proposal does enable the scenario, I also wonder how prominently should we advertise this two-step workaround as a solution?

It makes me wonder whether a good first class solution would be to token as a sibiling to uses. For example:

- uses: USER/private-hello-world-docker-action@v1
  token: ${{ secrets.GitHub_PAT }}

...on the other hand i also worry about extra concept of token at that level. What is the correct long term solution? Scopes on the job token? Or something else?

@chrispat
Copy link
Member

chrispat commented Dec 4, 2019

That is a side effect but also something that could be accomplished before this update. I don't think it really belongs in this repo. Perhaps we can look at a location in the help docs or perhaps a community post on this work around.

@francisfuzz
Copy link
Author

Eric, Chris: thanks for your feedback! I'll noodle on this a bit more and talk with our colleagues internally to see where we can field this workaround. Cheers!

@robinjhector
Copy link

Thanks for the documentation!
Are there any concrete plans to support private actions natively in GH Actions?

@missedone
Copy link

missedone commented May 28, 2020

same here, looking for native support for private actions, to be able to share the action in the organization for better reusability.

@haokanga
Copy link

Hi @francisfuzz, what is your decision on how/where to address the workaround using checkout to enable GitHub Action from another private repository?

There has been an ongoing discussion in the community about this concern.
https://github.community/t/github-action-action-in-private-repository/16063/28?u=haokanga

@francisfuzz
Copy link
Author

@haokanga - Hello! Thanks for raising the question here. I opened an internal issue for our documentation team to review, though I can't speak to when GitHub Help will be updated with those instructions.

As far as looking for native support for running GitHub Actions in other private repositories, I'm personally not able to speak to that. The best way to surface any support for that feature would be to our product team via this form:

https://support.github.com/contact/feedback

Sorry I couldn't be of more help here, though I do hope the approach posed here and in that thread are beneficial in the meantime!

@groundfloorwebb
Copy link

Thanks for the documentation @francisfuzz , i've been trying to figure out the best way to go about this and this seems like a solid solution. I like how github actions makes ci flows nice and composable, but the lack of support for abstraction into private repos is a real flaw at the moment when managing multiple codebases.

@stefanbuck
Copy link

This feature has been added to the roadmap github/roadmap#74

@rpgeddam
Copy link

and has also removed from the Q1-2021 milestone :(

@lgmorand
Copy link

yup and not even Q2 or Q3. that's really a bold move to postpone so far in the future after being planned for months :'(

@shreyaspurohit
Copy link

i am surprised this is not yet supported. For a lot of orgs with private repo's this is going to be useful. I am hopeful that it comes back on a near roadmap.

@RicardoJarree
Copy link

Is this only going to be a Github Enterprise feature now? Looking at the roadmap issue it seems that they are only going to be adding this feature for GitHub Enterprise users which is very disappointing. Has anyone used this on GitHub Enterprise as it was due for last quarter.

@timharris777
Copy link

Found this option in the ui under repos in our org that have .github/workflows folder.
image

However, trying this out it doesn't seem to work for referencing actions. It only works for reusable workflows. Is this by design? Other in the community are also confused about this setting: https://github.community/t/github-action-action-in-private-repository/16063/76?u=timharris777

@herereadthis
Copy link

@timharris777 how did you get to that option in the UI?

@timharris777
Copy link

@timharris777 how did you get to that option in the UI?

It only shows if the repo has GitHub actions workflows. Without a .GitHub/workflows folder with proper workflows the option does not seem to be available. It's in repo settings >> actions. Scroll to the bottom.

@ghost
Copy link

ghost commented Jan 14, 2022

Since it's unclear here, this is still not implemented. Hopefully we see it soon, imo it's a critical need for most enterprises that do not wish to rely on third party actions (due to security concerns) and also do not wish to publish their internal actions.

@genisd
Copy link

genisd commented Jan 24, 2022

+1 we really need this too 😢
Preferrably via pre-built images that get pulled from a private repo (as opposed to rebuilding the action every time)

@timharris777
Copy link

timharris777 commented Jan 24, 2022

This is now supported. I tested and was able to share actions workflows from internal repos with a private org or enterprise. Here is the latest announcement related to it. https://github.blog/changelog/2022-01-21-share-github-actions-within-your-enterprise/

@kuhnroyal
Copy link

I am able to share composite action from internal repos same as workflows.

@gnanderson
Copy link

gnanderson commented Jan 27, 2022

enterprise only tier, for this? 😑

@robinjhector
Copy link

enterprise only tier, for this? 😑

Yeah, I was also surprised. I've been waiting for this feature for a while.

@RayBB
Copy link

RayBB commented Mar 4, 2022

This is now GA but seems to be enterprise only still
https://github.blog/changelog/2022-03-04-sharing-github-actions-within-your-enterprise-is-now-ga/

@eriweb
Copy link

eriweb commented Mar 15, 2022

Do I understand correctly that this is only for Enterprise server?
We have enterprise cloud but I cannot see the 'Access' part under Settings -> Actions

@dataviruset
Copy link

dataviruset commented Apr 27, 2022

Also it seems the repository where the reusable workflow is stored needs to be internal rather than private. And this setting is only available if the organization is part of an Enterprise Account, just being on the enterprise plan isn't enough. And Enterprise Accounts are only available for those paying with invoice rather than credit card. Sigh...
https://docs.github.com/en/enterprise-cloud@latest/admin/overview/creating-an-enterprise-account

@WoodyWoodsta
Copy link

Want to post some swear-words but that wouldn't be allowed here.

Why on earth they've created this support crevice with actions is beyond me. The picture is currently:

  • Open source: public action

Massive support gap, spanning indie developers, small-medium paying organisations and enterprise plan subscribers

  • Enterprise accounts: internal action

What exactly were they thinking? Are they trying to scare away half of their customers? Albeit, that's exactly something Microsoft would do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests