-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package Size Issue with Azure Login GitHub Action #366
Labels
product enhancement
New feature or request
Comments
This was referenced Nov 11, 2023
Closed
I have created a pull request for the second solution: |
Thanks for pointing this out and working on this case @kWozniak-tt |
@kWozniak-tt, Thanks for raising this request. It's clear and helpful. We will add it to our plan. |
YanaXu
added
product enhancement
New feature or request
and removed
need-to-triage
Requires investigation
feature-request
labels
Dec 5, 2023
@MoChilia why this issue was unpinned |
@kWozniak-tt no worries, we'll pin it again after this release. It's still on our table. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I've identified a significant issue with the Azure login GitHub action, where the action's package size is excessively large. After unpacking, the node_modules directory alone is 118MB. This substantial size dramatically affects the startup time of the GitHub action. It seems all dependencies, including those not needed for production, are being installed in the package. Additionally, the package contains folders like tests, src, and .github, which are unnecessary for the action's operation.
Download Link
Proposed Solution:
Production-Optimized Configuration: Configure the package specifically for production use, adhering to npm standards. Exclude non-production dependencies and unnecessary folders like
__tests__
,src
, and.github
to reduce the package size and improve performance.Use of @vercel/ncc for Compiling Code: As an alternative to checking in the
node_modules
directory, which can cause issues, use the@vercel/ncc
tool to compile code and modules into a single file for distribution. This approach is suggested in GitHub's documentation. After installing@vercel/ncc
, compile theindex.js
file, resulting in a newdist/index.js
file with code and compiled modules, alongside adist/licenses.txt
file containing all licenses of the usednode_modules
. Update theaction.yml
file to usedist/index.js
and remove the previously checked-innode_modules
directory. This solution ensures a more efficient and streamlined package, in line with best practices for GitHub actions.The text was updated successfully, but these errors were encountered: