Azure / login

Connect to Azure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.
image
image
Download Link

Proposed Solution:

  1. 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.

  2. 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.

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.