Update npm package migration script to have a cutoff date #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the
scripts/migrate-npm-packages-between-github-instances.sh
script and updates the.env.example
file to support environment variables. The changes enhance usability, add new functionality, and improve performance by optimizing API calls.Environment Variable Support:
.env.example
: Added a template for required environment variables (SOURCE_HOST
,SOURCE_ORG
,GH_SOURCE_PAT
,TARGET_HOST
,TARGET_ORG
,GH_TARGET_PAT
) and a command to load them into the shell.Script Enhancements:
scripts/migrate-npm-packages-between-github-instances.sh
: Updated the script to accept an optional fifth argument,CUTOFF_DATE
, with a default value of one year ago, to filter package versions by creation date.scripts/migrate-npm-packages-between-github-instances.sh
: Modified the usage check to allow passing fewer than five arguments, improving flexibility.Performance Optimization:
scripts/migrate-npm-packages-between-github-instances.sh
: Cached package metadata in a temporary directory to reduce redundant API calls, improving script efficiency.