[GH-ISSUE #707] Issue: private action using local machine path and not docker container path #445

Closed
opened 2026-03-01 21:43:28 +03:00 by kerem · 4 comments
Owner

Originally created by @TonyRouse on GitHub (May 26, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/707

Act version

❯ act --version
act version 0.2.22

Expected behaviour

I checkout the actions repo of my organization and try to call an action in it. path is the same name as the repo because of the known issue with MODULE_NOT_FOUND in the README.

Actual behaviour

The error is looking for the right file, that IS on the docker container, but the path is it calling /Volumes/Code/.. is on my local machine, not the docker container.

Workflow and/or repository

workflow
name: example workflow

on: [push]

jobs:
  build:
    steps:
      - name: Checkout Action Repo
        uses: actions/checkout@v2
        with:
          repository: [organization]/actions
          ref: main
          token: ${{ secrets.GITHUB_PAT }}
          path: actions
      - uses: ./actions/gradle-build

Steps to reproduce

  • Have a private actions repo with gradle-build/action.yaml file
  • From a different repo workflow, checkout actions repo and trigger workflow with PAT

act output

Log
[test-workflow/build-it]   ❌  Failure - ./actions/gradle-build
Error: open /Volumes/Code/[organization]/[code]/actions/gradle-build/action.yaml: no such file or directory
Originally created by @TonyRouse on GitHub (May 26, 2021). Original GitHub issue: https://github.com/nektos/act/issues/707 ## Act version ```none ❯ act --version act version 0.2.22 ``` ## Expected behaviour I checkout the actions repo of my organization and try to call an action in it. `path` is the same name as the repo because of the known issue with `MODULE_NOT_FOUND` in the README. ## Actual behaviour The error is looking for the right file, that IS on the docker container, but the path is it calling `/Volumes/Code/..` is on my local machine, not the docker container. ## Workflow and/or repository <!-- - Provide workflow with which we can reproduce the issue OR - Provide link to your GitHub repository that contains the workflow --> <details> <summary>workflow</summary> ```none name: example workflow on: [push] jobs: build: steps: - name: Checkout Action Repo uses: actions/checkout@v2 with: repository: [organization]/actions ref: main token: ${{ secrets.GITHUB_PAT }} path: actions - uses: ./actions/gradle-build ``` </details> ## Steps to reproduce - Have a private `actions` repo with `gradle-build/action.yaml` file - From a different repo workflow, checkout actions repo and trigger workflow with PAT ## `act` output <!-- - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below --> <details> <summary>Log</summary> ```none [test-workflow/build-it] ❌ Failure - ./actions/gradle-build Error: open /Volumes/Code/[organization]/[code]/actions/gradle-build/action.yaml: no such file or directory ``` </details>
Author
Owner

@ekallevig commented on GitHub (May 28, 2021):

I ran into the same issue. However, I tried to test the theory that it's looking for the files on the local machine (and not the docker container) by putting the same files on my local machine and it still gave the same "not found" error. Which then made me wonder if perhaps it's permissions issue?

<!-- gh-comment-id:850550049 --> @ekallevig commented on GitHub (May 28, 2021): I ran into the same issue. However, I tried to test the theory that it's looking for the files on the local machine (and not the docker container) by putting the same files on my local machine and it still gave the same "not found" error. Which then made me wonder if perhaps it's permissions issue?
Author
Owner

@TonyRouse commented on GitHub (May 28, 2021):

I assumed this because the /Volumns/Code/.../.. file path is from my local system. I would wonder if your test didn't work because it is running in the container that doesn't have access to your local files. The "path to code" is from the directory structure one the local machine, the command is executed in the contain, which the file doesn't exist on.

<!-- gh-comment-id:850565001 --> @TonyRouse commented on GitHub (May 28, 2021): I assumed this because the `/Volumns/Code/.../..` file path is from my local system. I would wonder if your test didn't work because it is running in the container that doesn't have access to your local files. The "path to code" is from the directory structure one the local machine, the command is executed in the contain, which the file doesn't exist on.
Author
Owner

@ChristopherHX commented on GitHub (May 29, 2021):

My thoughts about this issue, after looking at the sources.

I assumed this because the /Volumns/Code/.../.. file path is from my local system

A recent change to act, use the exact same path of your host workdir inside the container (except on windows).

I think the problem is, act uses docker cp for local actions, from the host to the container. This leads missing files, at the action destination, which isn't your working dir.

Possible workaround, until fixed:
Clone [organization]/actions manually into your working dir, before running act (a .gitignore file excluding the action may break the workaround)
Disable the remote checkout step, to avoid overriding files.

name: example workflow

on: [push]

jobs:
  build:
    steps:
      - name: Checkout Action Repo
        if: ${{ !env.ACT }}
        uses: actions/checkout@v2
        with:
          repository: [organization]/actions
          ref: main
          token: ${{ secrets.GITHUB_PAT }}
          path: actions
      - uses: ./actions/gradle-build

I haven't tried it yet, but act has a lot of (reported and not reported) bug's in this area

<!-- gh-comment-id:850838022 --> @ChristopherHX commented on GitHub (May 29, 2021): My thoughts about this issue, after looking at the sources. > I assumed this because the /Volumns/Code/.../.. file path is from my local system [A recent change to act](https://github.com/nektos/act/pull/567), use the exact same path of your host workdir inside the container (except on windows). I think the problem is, act uses docker cp for local actions, from the host to the container. This leads missing files, at the action destination, which isn't your working dir. Possible workaround, until fixed: Clone `[organization]/actions` manually into your working dir, before running act (a `.gitignore` file excluding the action may break the workaround) Disable the remote checkout step, to avoid overriding files. ```yaml name: example workflow on: [push] jobs: build: steps: - name: Checkout Action Repo if: ${{ !env.ACT }} uses: actions/checkout@v2 with: repository: [organization]/actions ref: main token: ${{ secrets.GITHUB_PAT }} path: actions - uses: ./actions/gradle-build ``` _I haven't tried it yet, but act has a lot of (reported and not reported) bug's in this area_
Author
Owner

@github-actions[bot] commented on GitHub (Jun 29, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:870139739 --> @github-actions[bot] commented on GitHub (Jun 29, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#445
No description provided.