How to use a custom github action from another repository in my organization?

Viewed 1457

I'm following the examples of a docker Github action to create my own action. I would like to keep the action in a private repository in my organization, and then re-use it from another repositories under the same organization.

The documentation states that "When an action is in a private repository, the action can only be used in workflows in the same repository" but, to my understanding, it doesn't cover how such actions behave in organization context - only in standalone repo context. Do I have to make it public and on the marketplace, just to be able to re-use it in my own private organization?

Does anyone have any experience setting up such an action?

2 Answers

I have recently published a custom action to GitHub marketplace, You have two options:

  • Publish your custom GitHub action to the marketplace and then use it with any repository wherever you like however this will require you to make your code public
  • Second option is to copy all the contents of the GitHub action you created (entrypoint.sh, dockerfile and action.yml) to the repository where you want to use it and simply use it like this: uses: ./

Do let me know if this solves your problem, thanks

Related