Skip to content

Commit 438435c

Browse files
committed
fix: parse build env before install so secrets are available to nuxt prepare
1 parent a19a380 commit 438435c

1 file changed

Lines changed: 20 additions & 15 deletions

File tree

action.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ runs:
9191
cache: ${{ inputs.package-manager != 'none' && inputs.package-manager || '' }}
9292
cache-dependency-path: ${{ steps.lockfile.outputs.path }}
9393

94-
- name: Install dependencies
95-
if: ${{ inputs.mode == 'full' || inputs.mode == 'build' }}
96-
shell: bash
97-
working-directory: ${{ inputs.working-directory }}
98-
run: |
99-
# Auto-detect install command based on package manager if using default
100-
INSTALL_CMD="${{ inputs.install-command }}"
101-
if [ "$INSTALL_CMD" == "npm ci" ]; then
102-
case "${{ inputs.package-manager }}" in
103-
pnpm) INSTALL_CMD="pnpm install --frozen-lockfile" ;;
104-
yarn) INSTALL_CMD="yarn install --frozen-lockfile" ;;
105-
esac
106-
fi
107-
$INSTALL_CMD
108-
10994
- name: Parse build environment variables
11095
if: ${{ inputs.mode == 'full' || inputs.mode == 'build' }}
11196
id: build-env
@@ -227,6 +212,26 @@ runs:
227212
fi
228213
echo "::endgroup::"
229214
215+
- name: Install dependencies
216+
if: ${{ inputs.mode == 'full' || inputs.mode == 'build' }}
217+
shell: bash
218+
working-directory: ${{ inputs.working-directory }}
219+
run: |
220+
# Source build environment variables if they exist
221+
if [ -f /tmp/build-env.sh ]; then
222+
source /tmp/build-env.sh
223+
fi
224+
225+
# Auto-detect install command based on package manager if using default
226+
INSTALL_CMD="${{ inputs.install-command }}"
227+
if [ "$INSTALL_CMD" == "npm ci" ]; then
228+
case "${{ inputs.package-manager }}" in
229+
pnpm) INSTALL_CMD="pnpm install --frozen-lockfile" ;;
230+
yarn) INSTALL_CMD="yarn install --frozen-lockfile" ;;
231+
esac
232+
fi
233+
$INSTALL_CMD
234+
230235
- name: Build Worker
231236
if: ${{ inputs.mode == 'full' || inputs.mode == 'build' }}
232237
shell: bash

0 commit comments

Comments
 (0)