[GH-ISSUE #1874] How to clone repository instead of copying from local directory? #907

Closed
opened 2026-03-01 21:47:20 +03:00 by kerem · 3 comments
Owner

Originally created by @duzenko on GitHub (Jun 20, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1874

Bug report info

a@a-virtual-machine:/mnt/hgfs/Remote/cashare-react-ui$ ./bin/act --bug-report
act version:            0.2.46
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 6
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/a/.actrc:
		-P ubuntu-latest=node:16-buster-slim
		-P ubuntu-22.04=node:16-bullseye-slim
		-P ubuntu-20.04=node:16-buster-slim
		-P ubuntu-18.04=node:16-buster-slim
Build info:
	Go version:            go1.18.10
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.46 -X main.commit=b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 -X main.date=2023-06-01T02:39:24Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9
		vcs.time:             2023-06-01T02:39:05Z
		vcs.modified:         false
Docker Engine:
	Engine version:        24.0.2
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 22.10
	OS type:               linux
	OS version:            22.10
	OS arch:               x86_64
	OS kernel:             5.19.0-45-generic
	OS CPU:                6
	OS memory:             7936 MB
	Security options:
		name=apparmor
		name=seccomp,profile=builtin
		name=cgroupns

Command used with act

./bin/act

Describe issue

Entire node_modules directory gets copies each time an action runs
I'd like it to repeat what github actions do - clone and run npm i

No response

Workflow content

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
  push:
    branches: [ "master", "staging" ]
  
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/checkout@v2

    - name: Use Node.js
      uses: actions/setup-node@v2
      with:
        node-version: '12'
      
    - name: 🔨 Build Project
      run: |
        npm install
        yarn build

Relevant log output

a@a-virtual-machine:/mnt/hgfs/Remote/cashare-react-ui$ ./bin/act
[Node.js CI/🎉 Deploy   ] 🚀  Start image=node:16-buster-slim
[Node.js CI/🎉 Deploy   ]   🐳  docker pull image=node:16-buster-slim platform= username= forcePull=true
[Node.js CI/🎉 Deploy   ] using DockerAuthConfig authentication for docker pull
[Node.js CI/🎉 Deploy   ]   🐳  docker create image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/🎉 Deploy   ]   🐳  docker run image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/🎉 Deploy   ]   ☁  git clone 'https://github.com/actions/setup-node' # ref=v2
[Node.js CI/🎉 Deploy   ] ⭐ Run Main 🚚 Get latest code
[Node.js CI/🎉 Deploy   ]   🐳  docker cp src=/mnt/hgfs/Remote/cashare-react-ui/. dst=/mnt/hgfs/Remote/cashare-react-ui

Additional information

I've encountered mentions of "local actions" in other issues but can't see any docs on that

Originally created by @duzenko on GitHub (Jun 20, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1874 ### Bug report info ```plain text a@a-virtual-machine:/mnt/hgfs/Remote/cashare-react-ui$ ./bin/act --bug-report act version: 0.2.46 GOOS: linux GOARCH: amd64 NumCPU: 6 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /home/a/.actrc: -P ubuntu-latest=node:16-buster-slim -P ubuntu-22.04=node:16-bullseye-slim -P ubuntu-20.04=node:16-buster-slim -P ubuntu-18.04=node:16-buster-slim Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.46 -X main.commit=b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 -X main.date=2023-06-01T02:39:24Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 vcs.time: 2023-06-01T02:39:05Z vcs.modified: false Docker Engine: Engine version: 24.0.2 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 22.10 OS type: linux OS version: 22.10 OS arch: x86_64 OS kernel: 5.19.0-45-generic OS CPU: 6 OS memory: 7936 MB Security options: name=apparmor name=seccomp,profile=builtin name=cgroupns ``` ### Command used with act ```sh ./bin/act ``` ### Describe issue Entire node_modules directory gets copies each time an action runs I'd like it to repeat what github actions do - clone and run `npm i` ### Link to GitHub repository _No response_ ### Workflow content ```yml # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs name: Node.js CI on: push: branches: [ "master", "staging" ] jobs: web-deploy: name: 🎉 Deploy runs-on: ubuntu-latest steps: - name: 🚚 Get latest code uses: actions/checkout@v2 - name: Use Node.js uses: actions/setup-node@v2 with: node-version: '12' - name: 🔨 Build Project run: | npm install yarn build ``` ### Relevant log output ```sh a@a-virtual-machine:/mnt/hgfs/Remote/cashare-react-ui$ ./bin/act [Node.js CI/🎉 Deploy ] 🚀 Start image=node:16-buster-slim [Node.js CI/🎉 Deploy ] 🐳 docker pull image=node:16-buster-slim platform= username= forcePull=true [Node.js CI/🎉 Deploy ] using DockerAuthConfig authentication for docker pull [Node.js CI/🎉 Deploy ] 🐳 docker create image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Node.js CI/🎉 Deploy ] 🐳 docker run image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Node.js CI/🎉 Deploy ] ☁ git clone 'https://github.com/actions/setup-node' # ref=v2 [Node.js CI/🎉 Deploy ] ⭐ Run Main 🚚 Get latest code [Node.js CI/🎉 Deploy ] 🐳 docker cp src=/mnt/hgfs/Remote/cashare-react-ui/. dst=/mnt/hgfs/Remote/cashare-react-ui ``` ### Additional information I've encountered mentions of "local actions" in other issues but can't see any docs on that
kerem 2026-03-01 21:47:20 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ZauberNerd commented on GitHub (Jun 20, 2023):

act --no-skip-checkout (see also act --help).

<!-- gh-comment-id:1598670216 --> @ZauberNerd commented on GitHub (Jun 20, 2023): `act --no-skip-checkout` (see also `act --help`).
Author
Owner

@duzenko commented on GitHub (Jun 21, 2023):

@ZauberNerd Sorry, but how do make that work with a private repo?
I'd think it should just mount user's .ssh directory to docker container for seamless authentication, but in reality I get this

a@a-virtual-machine:/mnt/hgfs/Remote/cashare-react-ui$ act --no-skip-checkout
[Node.js CI/🎉 Deploy   ] 🚀  Start image=node:16-buster-slim
[Node.js CI/🎉 Deploy   ]   🐳  docker pull image=node:16-buster-slim platform= username= forcePull=true
[Node.js CI/🎉 Deploy   ] using DockerAuthConfig authentication for docker pull
[Node.js CI/🎉 Deploy   ]   🐳  docker create image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/🎉 Deploy   ]   🐳  docker run image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/🎉 Deploy   ]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2
[Node.js CI/🎉 Deploy   ]   ☁  git clone 'https://github.com/actions/setup-node' # ref=v2
[Node.js CI/🎉 Deploy   ]   ☁  git clone 'https://github.com/SamKirkland/FTP-Deploy-Action' # ref=4.1.0
[Node.js CI/🎉 Deploy   ] ⭐ Run Main 🚚 Get latest code
[Node.js CI/🎉 Deploy   ]   🐳  docker cp src=/home/a/.cache/act/actions-checkout@v2/ dst=/var/run/act/actions/actions-checkout@v2/
[Node.js CI/🎉 Deploy   ]   🐳  docker exec cmd=[node /var/run/act/actions/actions-checkout@v2/dist/index.js] user= workdir=
[Node.js CI/🎉 Deploy   ]   💬  ::debug::GITHUB_WORKSPACE = '/mnt/hgfs/Remote/cashare-react-ui'
[Node.js CI/🎉 Deploy   ]   💬  ::debug::qualified repository = 'CashareCode/cashare-react-ui'
[Node.js CI/🎉 Deploy   ]   💬  ::debug::ref = 'refs/heads/master'
[Node.js CI/🎉 Deploy   ]   💬  ::debug::commit = '95090c5b64edd129bc80d75c4843aad7f7ed9999'
[Node.js CI/🎉 Deploy   ]   💬  ::debug::clean = true
[Node.js CI/🎉 Deploy   ]   💬  ::debug::fetch depth = 1
[Node.js CI/🎉 Deploy   ]   💬  ::debug::lfs = false
[Node.js CI/🎉 Deploy   ]   💬  ::debug::submodules = false
[Node.js CI/🎉 Deploy   ]   💬  ::debug::recursive submodules = false
[Node.js CI/🎉 Deploy   ]   ❗  ::error::Input required and not supplied: token
[Node.js CI/🎉 Deploy   ]   ❌  Failure - Main 🚚 Get latest code
[Node.js CI/🎉 Deploy   ] exitcode '1': failure
[Node.js CI/🎉 Deploy   ] ⭐ Run Post 🚚 Get latest code
[Node.js CI/🎉 Deploy   ]   🐳  docker exec cmd=[node /var/run/act/actions/actions-checkout@v2/dist/index.js] user= workdir=
[Node.js CI/🎉 Deploy   ]   ✅  Success - Post 🚚 Get latest code
[Node.js CI/🎉 Deploy   ] 🏁  Job failed
Error: Job '🎉 Deploy' failed
<!-- gh-comment-id:1600572153 --> @duzenko commented on GitHub (Jun 21, 2023): @ZauberNerd Sorry, but how do make that work with a private repo? I'd think it should just mount user's `.ssh` directory to docker container for seamless authentication, but in reality I get this ``` a@a-virtual-machine:/mnt/hgfs/Remote/cashare-react-ui$ act --no-skip-checkout [Node.js CI/🎉 Deploy ] 🚀 Start image=node:16-buster-slim [Node.js CI/🎉 Deploy ] 🐳 docker pull image=node:16-buster-slim platform= username= forcePull=true [Node.js CI/🎉 Deploy ] using DockerAuthConfig authentication for docker pull [Node.js CI/🎉 Deploy ] 🐳 docker create image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Node.js CI/🎉 Deploy ] 🐳 docker run image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Node.js CI/🎉 Deploy ] ☁ git clone 'https://github.com/actions/checkout' # ref=v2 [Node.js CI/🎉 Deploy ] ☁ git clone 'https://github.com/actions/setup-node' # ref=v2 [Node.js CI/🎉 Deploy ] ☁ git clone 'https://github.com/SamKirkland/FTP-Deploy-Action' # ref=4.1.0 [Node.js CI/🎉 Deploy ] ⭐ Run Main 🚚 Get latest code [Node.js CI/🎉 Deploy ] 🐳 docker cp src=/home/a/.cache/act/actions-checkout@v2/ dst=/var/run/act/actions/actions-checkout@v2/ [Node.js CI/🎉 Deploy ] 🐳 docker exec cmd=[node /var/run/act/actions/actions-checkout@v2/dist/index.js] user= workdir= [Node.js CI/🎉 Deploy ] 💬 ::debug::GITHUB_WORKSPACE = '/mnt/hgfs/Remote/cashare-react-ui' [Node.js CI/🎉 Deploy ] 💬 ::debug::qualified repository = 'CashareCode/cashare-react-ui' [Node.js CI/🎉 Deploy ] 💬 ::debug::ref = 'refs/heads/master' [Node.js CI/🎉 Deploy ] 💬 ::debug::commit = '95090c5b64edd129bc80d75c4843aad7f7ed9999' [Node.js CI/🎉 Deploy ] 💬 ::debug::clean = true [Node.js CI/🎉 Deploy ] 💬 ::debug::fetch depth = 1 [Node.js CI/🎉 Deploy ] 💬 ::debug::lfs = false [Node.js CI/🎉 Deploy ] 💬 ::debug::submodules = false [Node.js CI/🎉 Deploy ] 💬 ::debug::recursive submodules = false [Node.js CI/🎉 Deploy ] ❗ ::error::Input required and not supplied: token [Node.js CI/🎉 Deploy ] ❌ Failure - Main 🚚 Get latest code [Node.js CI/🎉 Deploy ] exitcode '1': failure [Node.js CI/🎉 Deploy ] ⭐ Run Post 🚚 Get latest code [Node.js CI/🎉 Deploy ] 🐳 docker exec cmd=[node /var/run/act/actions/actions-checkout@v2/dist/index.js] user= workdir= [Node.js CI/🎉 Deploy ] ✅ Success - Post 🚚 Get latest code [Node.js CI/🎉 Deploy ] 🏁 Job failed Error: Job '🎉 Deploy' failed ```
Author
Owner

@ZauberNerd commented on GitHub (Jun 21, 2023):

@duzenko I looked into implementing it that way a while ago. Unfortunately it won't work, because that is not how GitHub Actions on github.com behave because they need a PAT (personal access token) instead of SSH. So you need to pass the github.token to the checkout action, as seen from the error message: ::error::Input required and not supplied: token check out the documentation for the checkout action: https://github.com/actions/checkout
See also the act documentation on the topic here: https://nektosact.com/beginner/index.html?highlight=token#github_token

<!-- gh-comment-id:1600612025 --> @ZauberNerd commented on GitHub (Jun 21, 2023): @duzenko I looked into implementing it that way a while ago. Unfortunately it won't work, because that is not how GitHub Actions on github.com behave because they need a PAT (personal access token) instead of SSH. So you need to pass the `github.token` to the checkout action, as seen from the error message: `::error::Input required and not supplied: token` check out the documentation for the checkout action: https://github.com/actions/checkout See also the act documentation on the topic here: https://nektosact.com/beginner/index.html?highlight=token#github_token
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#907
No description provided.