-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can't run local actions outside the workspace #2107
Comments
Issue is stale and will be closed in 14 days unless there is new activity |
This is still broken on the latest act, making it behave inconsistently with GitHub Actions. The linked PR provides a possible fix |
Note that technically
That said, I've run into github workflows that use this feature ( Whether people like it or not, this is a feature of the platform that's used by GitHub's own devs. |
We write an action.yml file to hardcoded well known folder which were we can use the env context or even use a native program to generate that. I built a conditional action as well that allows dynamic uses via inputs. A uses inside with inputs is just a normal input.
Depending on who you ask about this you get both yes and no as answer e.g. I never saw Local composite actions are sooo buggy, they leak their bugs into correctly working actions like you noticed yourself. |
Oh yes. Fwiw, check-spelling can rewrite its actions to work around the lack of expansion in actions. It's a handy workaround. Although I haven't used it yet. I'm quite tempted to use it to work around bugs in checkout, artifacts, and upload-sarif. (I've generally made PRs for each repository declaring my planned changes.) |
Bug report info
Command used with act
Describe issue
If you attempt to use a local action outside the workspace, act is unable to resolve it and emits a
file does not exist
error. It looks likegetContainerActionPaths
assumes local actions live under the$GITHUB_WORKSPACE
, so it ends up looking for them in a nonexistent path like$GITHUB_WORKSPACE/previously/absolute/path/to/action
.These workflows are able to run successfully on GitHub.
Rationale
This is a bit of an edge case, but I've run into this in an monorepo where some actions call other actions locally. The tl;dr: is that one composite action determines its own location via
github.action_path
, and then uses that to dynamically call other actions from the same checkout (via dynamic-uses). This way I can ensure that I use the exact same version for all actions, and that it works whether I'm using the actions from the current repo or from another one.Currently this all works fine when running on GitHub. When running under act, it works when I use the top-level action via local checkout, but it fails when I use it via ref, since it resolves the other actions to paths outside the workspace. To better illustrate what's happening, actions live under the
actions
subdirectory, and my top-level actions do something like this:While another approach might be to use the
github.action_ref
, I'd like to be able to use/test actions locally without needing the ref to exist (e.g. when testing changes locally via act).Link to GitHub repository
https://github.com/jenseng/dynamic-uses/actions/runs/7036492016/job/19149221462
Workflow content
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: