proposal: option to not follow symlinks when copying assets
See original GitHub issueChecklist
- I am using the latest version of this aciton.
- I have read the latest README and followed the instructions.
- I have read the latest GitHub Actions official documentation and learned the basic spec and concepts.
Describe your proposal
At the moment the copyAssets
step follows all symlinks to fetch their content:
(The -L
switch enables this behaviour.)
I would actually like to deploy a symlink to my gh-pages
environment rather than copy the contents.
Describe the solution you’d like
Could we add a followSymlinks
option, which defaults to true
to keep existing behavior.
If set to false
, copyAssets
uses -P
switch instead of -L
.
I want to use followSymlinks: false
plus keepFiles: true
to create a CI job which updates a symlink and does nothing else.
Describe alternatives you’ve considered
Additional context
In fact, I am actually attempting to create the symlink in a CI job, and it’s creating an interesting failure:
https://github.com/PyO3/pyo3/runs/3278446262?check_suite_focus=true
The relevant log is:
[INFO] first deployment, create new branch gh-pages
[INFO] no such file or directory: /home/runner/work/pyo3/pyo3/public/latest
[INFO] chdir /home/runner/actions_github_pages_1628498412192
/usr/bin/git init
Reinitialized existing Git repository in /home/runner/actions_github_pages_1628498412192/.git/
/usr/bin/git checkout --orphan gh-pages
fatal: A branch named 'gh-pages' already exists.
Looks like the copyAssets
step fails because this symlink is dangling in the local checkout. This then causes the action to try to initialize a new gh-pages
branch, which is incorrect and causes a crash.
So there’s maybe also a separate bug here about failure in the copyAssets
step causing the action to incorrectly switch to first-deployment mode.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top GitHub Comments
Also looking forward to this!
I was using https://github.com/crazy-max/ghaction-github-pages/tree/v2 and didn’t think much about how it handled symlinks.
I just tried upgrading to this action instead because it handles
.nojekyll
andCNAME
inline, and pushes commits on top instead of wiping and repushing the entiregh-pages
branch every time, and tags the deployed commit ID in thegh-pages
commit it makes, and generally seems better supported, but I did immediately notice that it copied instead of symlinked this file: https://github.com/neuropoly/neuropoly-docs/commit/f371d46e964105a54ac43a92355e499236168b8c#diff-0eb547304658805aad788d320f10bf1f292797b5e6d745a3bf617584da017051So, also very much looking forward to this!
And thanks for making such a tidy and well-supported Action 😃
This feature sounds great 🎉 Deploying symlinks instead of copying the complete folder would help us a lot to simplify our setup and would also save a bit CI time. Looking forward to it 😍.