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 the index.js file, resulting in a new dist/index.js file with code and compiled modules, alongside a dist/licenses.txt file containing all licenses of the used node_modules. Update the action.yml file to use dist/index.js and remove the previously checked-in node_modules directory. This solution ensures a more efficient and streamlined package, in line with best practices for GitHub actions.
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.githubto reduce the package size and improve performance.Use of @vercel/ncc for Compiling Code: As an alternative to checking in the
node_modulesdirectory, which can cause issues, use the@vercel/ncctool 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.jsfile, resulting in a newdist/index.jsfile with code and compiled modules, alongside adist/licenses.txtfile containing all licenses of the usednode_modules. Update theaction.ymlfile to usedist/index.jsand remove the previously checked-innode_modulesdirectory. This solution ensures a more efficient and streamlined package, in line with best practices for GitHub actions.