Closed jsoref closed 1 month ago
Fwiw,
--use-new-action-cache
doesn't appear to change this
For me is that flag needed to trigger this.
FYI You have --use-new-action-cache
in your $HOME/.actrc
so removing it from the cli itself doesn't opt out
Act (master) in old action cache mode GitHub Codespace
[Test/test] [DEBUG] using github ref: refs/heads/main
[Test/test] [DEBUG] Found revision: 8dcc4099101efc231b45c40c39f8236b55d86061
[Test/test] [DEBUG] Wrote command
ls -hal $GITHUB_ACTION_PATH
ls -hal $GITHUB_ACTION_PATH/.github/workflows
to 'workflow/0-composite-1.sh'
[Test/test] [DEBUG] Writing entry to tarball workflow/0-composite-1.sh len:76
[Test/test] [DEBUG] Extracting content to '/var/run/act'
[Test/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0-composite-1.sh] user= workdir=
[Test/test] [DEBUG] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0-composite-1.sh]'
[Test/test] [DEBUG] Working directory '/workspaces/act/sturdy-tribble-2'
| total 20K
| drwxr-xr-x 4 root root 4.0K May 22 17:50 .
| drwxr-xr-x 3 root root 4.0K May 22 17:50 ..
| drwxr-xr-x 4 root root 4.0K May 22 17:50 .git
| drwxr-xr-x 3 root root 4.0K May 22 17:50 .github
| -rw-r--r-- 1 root root 331 May 22 17:47 action.yml
| total 12K
| drwxr-xr-x 2 root root 4.0K May 22 17:50 .
| drwxr-xr-x 3 root root 4.0K May 22 17:50 ..
| lrwxrwxrwx 1 root root 8 May 22 17:47 case -> test.yml
| -rw-r--r-- 1 root root 198 May 22 17:47 test.yml
[Test/test] ✅ Success - Main look
[Test/test] [DEBUG] Loading revision from git directory
[Test/test] [DEBUG] Found revision: 8dcc4099101efc231b45c40c39f8236b55d86061
[Test/test] [DEBUG] HEAD points to '8dcc4099101efc231b45c40c39f8236b55d86061'
[Test/test] [DEBUG] using github ref: refs/heads/main
[Test/test] [DEBUG] Found revision: 8dcc4099101efc231
Oh, oops. Well, GitHub changed (for security reasons) away from retaining symbolic links, so the old act behavior hasn't been a match to GitHub's behavior for a while either.
I could have had a script that depended on symlinks not being retained which would have broken with the standard act behavior. (Heck, I might...)
Oh I forget that actions/runner uses IOUtil.CopyDirectory
that lacks symlink support, since 2019.
GitHub changed (for security reasons) away from retaining symbolic links
I'm not shure if they were ever preserved by the actions/runner, as the IOUtil.CopyDirectory
always converted them back to a fully copy after extracting.
It's easier for me to preserve symlinks correctly than trying to replace them by file contents. I imageine needing to fetch additional data of the git object and modifying the filecollector to optionally follow symlinks.
I assume this creates a copy instead of preserving the link https://github.com/actions/runner/blame/ce4d7be00f4834b6889a82ea55020bb15fa834bf/src/Runner.Worker/ActionManager.cs#L890
Bug report info
Command used with act
Describe issue
symbolic links in github action repositories are converted to 0 byte files when used by workflows.
Link to GitHub repository
https://github.com/check-spelling-sandbox/sturdy-tribble-2
Workflow content
Relevant log output
Additional information
https://github.com/check-spelling-sandbox/sturdy-tribble-2/actions/runs/9178827583/job/25246453375#step:2:83
The key line is:
Act output:
Fwiw,
--use-new-action-cache
doesn't appear to change thisApparently, the expected results are a file that contains the contents of the resolved link (not a symbolic link).