[GH-ISSUE #764] Issue: can not copy the symbolic links, if symlink to file which does not exist yet #482

Closed
opened 2026-03-01 21:43:47 +03:00 by kerem · 1 comment
Owner

Originally created by @Jona-lee on GitHub (Aug 5, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/764

Originally assigned to: @catthehacker on GitHub.

System information

  • Operating System: < Ubuntu 18.04>
  • Architecture: < x64 (64-bit) >
  • Apple M1: < no >
  • Docker version: < Docker version 20.10.2, build 20.10.2-0ubuntu1~18.04.3>
  • act version: <act version 0.2.24>

Expected behaviour

Handle symbolic links correctly, never follow symbolic links in SOURCE.

Actual behaviour

run act failed.

Workflow and/or repository

name: Build Firmware

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-18.04

    steps:
    - uses: actions/checkout@v2
    - name: Install Tools
      run: apt-get install mtd-utils rsync
    - name: imagebuild
      run: |
          echo "pack rootfs" >pack.log

    - name: Archive Binary
      uses: actions/upload-artifact@v2
      with:
        name: rootfs
        path: |
          pack.log
# create a repository for test
mkdir act_test
cd act_test
mkdir rootfs
cd rootfs
ln -sf /tmp/file_not_exist file_symbolic

~/act_test$ tree -a
.
├── .github
│   └── workflows
│       └── build_fimware.yml
└── rootfs
    └── file_symbolic -> /tmp/file_not_exist

3 directories, 2 files

Steps to reproduce

sudo act -v

act output

Log
:~/act_test$ sudo act -v 
DEBU[0000] Loading environment from /home/jwli/act_test/.env 
DEBU[0000] Loading secrets from /home/jwli/act_test/.secrets 
DEBU[0000] Loading workflows from '/home/jwli/act_test/.github/workflows' 
DEBU[0000] Loading workflows recursively                
DEBU[0000] Found workflow 'build_fimware.yml' in '/home/jwli/act_test/.github/workflows/build_fimware.yml' 
DEBU[0000] Reading workflow '/home/jwli/act_test/.github/workflows/build_fimware.yml' 
DEBU[0000] Correcting if statements '/home/jwli/act_test/.github/workflows/build_fimware.yml' 
DEBU[0000] Planning event: push                         
WARN[0000] unable to get git repo: unable to find git repo 
WARN[0000] unable to get git revision: unable to find git repo 
WARN[0000] unable to get git ref: unable to find git repo 
DEBU[0000] context env => map[ACT:true]                 
DEBU[0000] context needs => map[]                       
[Build Firmware/build] 🚀  Start image=catthehacker/ubuntu:act-18.04
WARN[0000] unable to get git repo: unable to find git repo 
WARN[0000] unable to get git revision: unable to find git repo 
WARN[0000] unable to get git ref: unable to find git repo 
[Build Firmware/build]   🐳  docker pull catthehacker/ubuntu:act-18.04
DEBU[0000] Image exists? true                           
[Build Firmware/build] Removed container: 1ef247b48476aaf876d5f594e87eec583a78a2b9a52d369cfa7c42e8197fc509
[Build Firmware/build]   🐳  docker volume rm act-Build-Firmware-build
[Build Firmware/build]   🐳  docker create image=catthehacker/ubuntu:act-18.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Build Firmware/build] Created container name=act-Build-Firmware-build id=03e5dfaa1fd86e73e0cd84d240e9798610d41fdd4a5b62421c3c46a4f3536bd1 from image catthehacker/ubuntu:act-18.04 (platform: )
[Build Firmware/build] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[Build Firmware/build]   🐳  docker run image=catthehacker/ubuntu:act-18.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Build Firmware/build] Starting container: 03e5dfaa1fd86e73e0cd84d240e9798610d41fdd4a5b62421c3c46a4f3536bd1
[Build Firmware/build] Started container: 03e5dfaa1fd86e73e0cd84d240e9798610d41fdd4a5b62421c3c46a4f3536bd1
[Build Firmware/build]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[Build Firmware/build] Exec command '[mkdir -m 0777 -p /var/run/act]'
[Build Firmware/build]   🐳  docker cp src=/home/jwli/act_test/. dst=/home/jwli/act_test
[Build Firmware/build]   🐳  docker exec cmd=[mkdir -p /home/jwli/act_test] user=
[Build Firmware/build] Exec command '[mkdir -p /home/jwli/act_test]'
DEBU[0002] Writing tarball /tmp/act775934521 from /home/jwli/act_test/. 
DEBU[0002] Stripping prefix:/home/jwli/act_test/ src:/home/jwli/act_test/. 
DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory 
DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory 
DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory 
DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory 
DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory 
DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory 
Error: open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory
Originally created by @Jona-lee on GitHub (Aug 5, 2021). Original GitHub issue: https://github.com/nektos/act/issues/764 Originally assigned to: @catthehacker on GitHub. ## System information - Operating System: < Ubuntu 18.04> - Architecture: < x64 (64-bit) > - Apple M1: < no > - Docker version: < Docker version 20.10.2, build 20.10.2-0ubuntu1~18.04.3> - `act` version: <act version 0.2.24> ## Expected behaviour Handle symbolic links correctly, never follow symbolic links in SOURCE. ## Actual behaviour run act failed. ## Workflow and/or repository ```none name: Build Firmware on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Install Tools run: apt-get install mtd-utils rsync - name: imagebuild run: | echo "pack rootfs" >pack.log - name: Archive Binary uses: actions/upload-artifact@v2 with: name: rootfs path: | pack.log ``` ``` # create a repository for test mkdir act_test cd act_test mkdir rootfs cd rootfs ln -sf /tmp/file_not_exist file_symbolic ~/act_test$ tree -a . ├── .github │   └── workflows │   └── build_fimware.yml └── rootfs └── file_symbolic -> /tmp/file_not_exist 3 directories, 2 files ``` ## Steps to reproduce sudo act -v ## `act` output <details> <summary>Log</summary> ```none :~/act_test$ sudo act -v DEBU[0000] Loading environment from /home/jwli/act_test/.env DEBU[0000] Loading secrets from /home/jwli/act_test/.secrets DEBU[0000] Loading workflows from '/home/jwli/act_test/.github/workflows' DEBU[0000] Loading workflows recursively DEBU[0000] Found workflow 'build_fimware.yml' in '/home/jwli/act_test/.github/workflows/build_fimware.yml' DEBU[0000] Reading workflow '/home/jwli/act_test/.github/workflows/build_fimware.yml' DEBU[0000] Correcting if statements '/home/jwli/act_test/.github/workflows/build_fimware.yml' DEBU[0000] Planning event: push WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo DEBU[0000] context env => map[ACT:true] DEBU[0000] context needs => map[] [Build Firmware/build] 🚀 Start image=catthehacker/ubuntu:act-18.04 WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo [Build Firmware/build] 🐳 docker pull catthehacker/ubuntu:act-18.04 DEBU[0000] Image exists? true [Build Firmware/build] Removed container: 1ef247b48476aaf876d5f594e87eec583a78a2b9a52d369cfa7c42e8197fc509 [Build Firmware/build] 🐳 docker volume rm act-Build-Firmware-build [Build Firmware/build] 🐳 docker create image=catthehacker/ubuntu:act-18.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build Firmware/build] Created container name=act-Build-Firmware-build id=03e5dfaa1fd86e73e0cd84d240e9798610d41fdd4a5b62421c3c46a4f3536bd1 from image catthehacker/ubuntu:act-18.04 (platform: ) [Build Firmware/build] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [Build Firmware/build] 🐳 docker run image=catthehacker/ubuntu:act-18.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build Firmware/build] Starting container: 03e5dfaa1fd86e73e0cd84d240e9798610d41fdd4a5b62421c3c46a4f3536bd1 [Build Firmware/build] Started container: 03e5dfaa1fd86e73e0cd84d240e9798610d41fdd4a5b62421c3c46a4f3536bd1 [Build Firmware/build] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root [Build Firmware/build] Exec command '[mkdir -m 0777 -p /var/run/act]' [Build Firmware/build] 🐳 docker cp src=/home/jwli/act_test/. dst=/home/jwli/act_test [Build Firmware/build] 🐳 docker exec cmd=[mkdir -p /home/jwli/act_test] user= [Build Firmware/build] Exec command '[mkdir -p /home/jwli/act_test]' DEBU[0002] Writing tarball /tmp/act775934521 from /home/jwli/act_test/. DEBU[0002] Stripping prefix:/home/jwli/act_test/ src:/home/jwli/act_test/. DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory DEBU[0002] open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory Error: open /home/jwli/act_test/rootfs/file_symbolic: no such file or directory ``` </details>
Author
Owner

@catthehacker commented on GitHub (Aug 9, 2021):

Given previous conversations about symlinks the decision for now is to not touch current implementation (https://github.com/nektos/act/issues/209).
You can use -b flag to bind directory which should work with symlinks just fine

<!-- gh-comment-id:895483313 --> @catthehacker commented on GitHub (Aug 9, 2021): Given previous conversations about symlinks the decision for now is to not touch current implementation (https://github.com/nektos/act/issues/209). You can use `-b` flag to bind directory which should work with symlinks just fine
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#482
No description provided.