Skip to content

Commit 2b1bbd8

Browse files
authored
fix(release): patch lodash-es inside action's own node_modules (#189)
The workspace-level npm install does not affect semantic-release which runs from _actions/cycjimmy/semantic-release-action/*/node_modules/. Override lodash-es directly in the action directory.
1 parent 42c97a9 commit 2b1bbd8

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,14 @@ jobs:
148148
@semantic-release/exec
149149
150150
# WORKAROUND: lodash-es@4.18.0 has a broken import (assignWith undefined).
151-
# Pin to last known-good version until upstream publishes a fix.
151+
# Pin to last known-good version inside the action's own node_modules.
152152
- name: Pin lodash-es to avoid 4.18.0 bug
153-
working-directory: ${{ matrix.app.working_dir }}
154-
run: npm install lodash-es@4.17.23
153+
run: |
154+
ACTION_DIR="${GITHUB_WORKSPACE}/../_actions/cycjimmy/semantic-release-action/b12c8f6015dc215fe37bc154d4ad456dd3833c90"
155+
cd "${ACTION_DIR}/node_modules/lodash-es" && npm pack lodash-es@4.17.23 2>/dev/null && tar xzf lodash-es-4.17.23.tgz --strip-components=1 && rm -f lodash-es-4.17.23.tgz
156+
if [ -d "${ACTION_DIR}/node_modules/semantic-release/node_modules/lodash-es" ]; then
157+
cd "${ACTION_DIR}/node_modules/semantic-release/node_modules/lodash-es" && npm pack lodash-es@4.17.23 2>/dev/null && tar xzf lodash-es-4.17.23.tgz --strip-components=1 && rm -f lodash-es-4.17.23.tgz
158+
fi
155159
156160
# ----------------- Snapshot tags before release -----------------
157161
- name: Snapshot tags before release

.github/workflows/typescript-release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,14 @@ jobs:
168168
@semantic-release/exec@7.1.0
169169
170170
# WORKAROUND: lodash-es@4.18.0 has a broken import (assignWith undefined).
171-
# Pin to last known-good version until upstream publishes a fix.
171+
# Pin to last known-good version inside the action's own node_modules.
172172
- name: Pin lodash-es to avoid 4.18.0 bug
173-
working-directory: ${{ matrix.app.working_dir }}
174-
run: npm install lodash-es@4.17.23
173+
run: |
174+
ACTION_DIR="${GITHUB_WORKSPACE}/../_actions/cycjimmy/semantic-release-action/b12c8f6015dc215fe37bc154d4ad456dd3833c90"
175+
cd "${ACTION_DIR}/node_modules/lodash-es" && npm pack lodash-es@4.17.23 2>/dev/null && tar xzf lodash-es-4.17.23.tgz --strip-components=1 && rm -f lodash-es-4.17.23.tgz
176+
if [ -d "${ACTION_DIR}/node_modules/semantic-release/node_modules/lodash-es" ]; then
177+
cd "${ACTION_DIR}/node_modules/semantic-release/node_modules/lodash-es" && npm pack lodash-es@4.17.23 2>/dev/null && tar xzf lodash-es-4.17.23.tgz --strip-components=1 && rm -f lodash-es-4.17.23.tgz
178+
fi
175179
176180
- name: Semantic Release
177181
uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6

0 commit comments

Comments
 (0)