I copied the JavaScript template over to a private repository and then added the action to another repo: - uses: aai/cache@v1.
This is the log output:
Download action repository 'aai/cache@v1'
##[warning]Failed to download action 'https://api.github.com/repos/aai/cache/tarball/v1'. Error Response status code does not indicate success: 404 (Not Found).
##[warning]Back off 27.679 seconds before retry.
##[warning]Failed to download action 'https://api.github.com/repos/aai/cache/tarball/v1'. Error Response status code does not indicate success: 404 (Not Found).
##[warning]Back off 14.294 seconds before retry.
##[error]Response status code does not indicate success: 404 (Not Found).
Choosing a location for your action only covers using public repositories for GitHub Actions, or putting the action in the repository using the action. So I'm not surprised what I'm trying to do didn't work, but I'm wondering if there are any plans to support this use case?
You're correct that right now we don't support this yet, @chrispat what are our plans around this?
Note that right now you can reference an action from your own repo via relative paths. This provides _some_ of the functionality private actions would bring (though admittedly not in a reusable way).
So for example, to reference an action that has its action.yml file in {repo root}/my-actions/action1, you could do the following in your workflow.yml - uses: ./my-actions/action1
+1 for this. Pretty much every organization has multiple private repositories and being able to reuse in-house actions across those repositories is a must-have, in my opinion.
@damccorm I've tried moving our custom action in one of our private repositories as you suggested:
{repo root}/actions/action1/{here is where action.yml, src, lib and other files are}.
I also updated the uses in the workflow to uses: ./actions/action1 but I get the following error when the workflow runs:
##[error]Can't find 'action.yml' or 'Dockerfile' under '/home/runner/work/{org}/{repo}/actions/action1'.
Any ideas?
One thing that has gotten me before (and may be what you're dealing with here) is that you need to run action/checkout before the action so that your source code makes it down to the right location.
That was it! Thank you @damccorm.
Glad I could help! Also added an internal PR to make that error a little more clear/point to checkout so hopefully it can be avoided by others going forward.
Is there a plan to support this in the future?
At somepoint in the future we may support this but it is not on our near term backlog.
That's very disappointing to hear. We were planning to use GitHub actions in favor of Jenkins but since migrating the custom Jenkins plugins to GitHub actions that we were using will mean we'll have to make them public this is a dealbreaker so we'll have to stay on Jenkins from what it seems.