Skip to content

Commit

Permalink
feat: adding handling of multiple plugins in a list
Browse files Browse the repository at this point in the history
  • Loading branch information
juancarlosjr97 committed Feb 11, 2024
1 parent 14e31db commit 72d041a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
-e GIT_DIRECTORY="/app" \
-e GIT_EMAIL=${GIT_EMAIL} \
-e GIT_USERNAME="${GIT_USERNAME}" \
-e RELEASE_IT_PLUGINS="@release-it/conventional-changelog@latest" \
-e RELEASE_IT_PLUGINS="@release-it/conventional-changelog@latest,@release-it/bumper@latest" \
-v $PWD:/app \
ghcr.io/${{ github.repository }}:${{ github.sha }} \
release-it --dry-run
Expand All @@ -38,7 +38,7 @@ jobs:
-e GIT_USERNAME="${GIT_USERNAME}" \
-e GPG_PRIVATE_KEY="${GPG_PRIVATE_KEY}" \
-e GPG_PRIVATE_KEY_ID="${GPG_PRIVATE_KEY_ID}" \
-e RELEASE_IT_PLUGINS="@release-it/conventional-changelog@latest" \
-e RELEASE_IT_PLUGINS="@release-it/conventional-changelog@latest,@release-it/bumper@latest" \
-v $PWD:/app \
ghcr.io/${{ github.repository }}:${{ github.sha }} \
release-it --dry-run
Expand All @@ -57,7 +57,7 @@ jobs:
-e GIT_USERNAME="${GIT_USERNAME}" \
-e GPG_PRIVATE_KEY="${GPG_PRIVATE_KEY}" \
-e GPG_PRIVATE_KEY_ID="${GPG_PRIVATE_KEY_ID}" \
-e RELEASE_IT_PLUGINS="@release-it/conventional-changelog@latest" \
-e RELEASE_IT_PLUGINS="@release-it/conventional-changelog@latest,@release-it/bumper@latest" \
-e SSH_PRIVATE_KEY_FILE="${SSH_PRIVATE_KEY_FILE}" \
-v $PWD:/app \
ghcr.io/${{ github.repository }}:${{ github.sha }} \
Expand Down
9 changes: 7 additions & 2 deletions release-it-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ mkdir -p "${NPM_GLOBAL_DIR}"
npm config set prefix "${NPM_GLOBAL_DIR}"
npm config set update-notifier false -g

# Install release-it globally
npm install --silent -g release-it@"${RELEASE_IT_VERSION}" "${RELEASE_IT_PLUGINS}"
# Split the plugin list into an installable command
IFS=',' read -ra RELEASE_IT_PLUGINS_LIST <<< "${RELEASE_IT_PLUGINS}"
RELEASE_IT_PLUGINS_SEPARATED="${RELEASE_IT_PLUGINS_LIST[*]}"

# To streamline the installation process, globally install release-it along with any required plugins.
# shellcheck disable=SC2086 # The variable RELEASE_IT_PLUGINS_SEPARATED is appropriately split to facilitate the installation of plugins.
npm install -g release-it@"${RELEASE_IT_VERSION}" ${RELEASE_IT_PLUGINS_SEPARATED}

# Execute the provided command
exec "$@"

0 comments on commit 72d041a

Please sign in to comment.