feat: Add option to modify whether symlink if followed in ZIP archive #1803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First step at fixing actions/upload-artifact#93
Currently,
upload-artifact
automatically follows symlinks present in specified paths. The problem with this approach is that it breaks macOS code-signed application packages that contains symlinks (like Electron) if the.app
folder is specified to path without it being zipped. If we don't follow the symlink and simply preserve the symlinks as is, macOS code-signed Electron application no longer stops working.Two changes are required to be able to allow disabling follow symlink.
The first is to return the target path of a symlink with
getUploadZipSpecification
, modifyingcreateZipUploadStream
with option to follow symlinks and adding symlink to zip as necessary.The second is to add the option to
upload-artifact
and passing the option touploadArtifact
method.I have already done both of the changes and have tested it to make sure it is working as intended with forked upload-artifact
eXhumer/upload-artifact@0b7d5f5684d3f642f978d2faad9ade64f5b4dd57
.With the changes and specifying
follow-symlinks: false
in my GitHub Action workflow, upload-artifact no longer breaks the macOS application package.