Package Size Issue with Azure Login GitHub Action
kWozniak-tt opened this issue · comments
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.
I have created a pull request for the second solution:
#367
I also tested it in my repository
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.
@MoChilia why this issue was unpinned
@kWozniak-tt no worries, we'll pin it again after this release. It's still on our table.