Local Action not found in workflow #25153
-
I have my main workflow (/.github/workflows/builds.yml) :
Attempting to use a local action that runs other actions that end up being duplicated across other jobs in the same workflow. I’m trying to avoid duplicating a lot of the same process in my CI Builds by having a local action to call that runs the same steps needed when executed. I’ve simplified my local action to this (/.github/actions/shared-setup.yml) :
When I run the checks the following error happens:
I stumbled on this topic https://github.community/t5/GitHub-Actions/Path-to-action-in-the-same-repository-as-workflow/td-p/38761 but from the answer and the docs I assume I have everything configured correctly. I’m running checkout prior to running my local action. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I did successfully find the action now, however, maybe this approach is wrong for what I’m doing.
So now my workflow does find the action but another issue is introduced: My main workflow runs on It’s possible I’m trying to use a local action in a way that is not supported. At the end of the day I’m just trying to reduce duplication across jobs. I was unable to get YAML aliases working with github actions (assumed not supported) so I thought maybe using a local action would help keep my workflow DRY. Instead of repeating the same setup steps in 4 jobs. |
Beta Was this translation helpful? Give feedback.
-
Your request is similar to set up job/step templates which can be referenced in workflow definitions. But as I have mentioned in this ticket, currently GitHub Actions does not support job/step templates. Maybe you can try to encapsulate the repeated steps into one action, for example if the repeated steps are executing some command lines, so that you just need to use this action in each job. However, most of the time, it is very hard and troublesome to encapsulate multiple jobs/steps into one action. I recommend that you can directly report a feature request here. That will allow you to directly interact with the appropriate engineering team, and make it more convenient for the engineering team to collect and categorize your suggestions. |
Beta Was this translation helpful? Give feedback.
-
I think all of us would love this feature. Just today the team I’m on asked if we can reuse this instead of copy pasting for minor differences in workflow. |
Beta Was this translation helpful? Give feedback.
-
Do we need to crate a folder named actions parallel to workflow folder here? and if so, what should actions folder consists of? below is my .yml file
Highlighted circle is the hierarchy of the action files in my repo. |
Beta Was this translation helpful? Give feedback.
Your request is similar to set up job/step templates which can be referenced in workflow definitions. But as I have mentioned in this ticket, currently GitHub Actions does not support job/step templates.
Maybe you can try to encapsulate the repeated steps into one action, for example if the repeated steps are executing some command lines, so that you just need to use this action in each job. However, most of the time, it is very hard and troublesome to encapsulate multiple jobs/steps into one action.
I recommend that you can directly report a feature request here. That will allow you to directly interact with the appropriate engineering team, and make it more convenient for the engineerin…