Skip to content
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

Closed
kWozniak-tt opened this issue Nov 10, 2023 · 6 comments · Fixed by #428
Closed

Package Size Issue with Azure Login GitHub Action #366

kWozniak-tt opened this issue Nov 10, 2023 · 6 comments · Fixed by #428
Assignees
Labels
product enhancement New feature or request

Comments

@kWozniak-tt
Copy link

kWozniak-tt commented Nov 10, 2023

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.

@kWozniak-tt
Copy link
Author

I have created a pull request for the second solution:
#367
I also tested it in my repository

@jharbieh-microsoft
Copy link

Thanks for pointing this out and working on this case @kWozniak-tt

@YanaXu YanaXu self-assigned this Nov 20, 2023
@YanaXu
Copy link
Collaborator

YanaXu commented Nov 23, 2023

@kWozniak-tt, Thanks for raising this request. It's clear and helpful. We will add it to our plan.

@YanaXu YanaXu pinned this issue Nov 23, 2023
@jharbieh-microsoft
Copy link

jharbieh-microsoft commented Nov 27, 2023 via email

@YanaXu YanaXu added product enhancement New feature or request and removed need-to-triage Requires investigation feature-request labels Dec 5, 2023
@MoChilia MoChilia unpinned this issue Jan 9, 2024
@kWozniak-tt
Copy link
Author

@MoChilia why this issue was unpinned

@YanaXu
Copy link
Collaborator

YanaXu commented Jan 16, 2024

@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
Labels
product enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants