mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #2107] Can't run local actions outside the workspace #1008
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1008
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jenseng on GitHub (Nov 29, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2107
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 existerror. It looks likegetContainerActionPathsassumes 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
actionssubdirectory, 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
@github-actions[bot] commented on GitHub (May 28, 2024):
Issue is stale and will be closed in 14 days unless there is new activity
@jenseng commented on GitHub (May 28, 2024):
This is still broken on the latest act, making it behave inconsistently with GitHub Actions. The linked PR provides a possible fix
@jsoref commented on GitHub (Nov 4, 2024):
Note that technically
envisn't allowed inuses: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#env-contextThat said, I've run into github workflows that use this feature (
uses: ./../something) (as I noted in: https://github.com/nektos/act/issues/1579#issuecomment-2455650040).Whether people like it or not, this is a feature of the platform that's used by GitHub's own devs.
@ChristopherHX commented on GitHub (Nov 5, 2024):
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.
That was at a time composite action only had uses without if.
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.
${{ insert }}is a feature, when I asked action/runner maintainer the answer was no this is not a supported feature and has no docs.I never saw
./../in the GitHub Docs anywhere and never had the idea to do that.Local composite actions are sooo buggy, they leak their bugs into correctly working actions like you noticed yourself.
@jsoref commented on GitHub (Nov 5, 2024):
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.)
@rodbalp commented on GitHub (May 26, 2025):
Issue is stale and will be closed in 14 days unless there is new activity
@jenseng commented on GitHub (May 28, 2025):
Bump