Skip to content

Commit a7d0501

Browse files
committed
improve(action): support pnpm and npm package managers
1 parent 3b4d738 commit a7d0501

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

action.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,23 @@ runs:
2929
shell: bash
3030
run: |
3131
corepack enable
32-
yarn_version=$(yarn --version)
33-
yarn_version_major=${yarn_version:0:1}
3432
35-
if [ "${yarn_version_major}" = '1' ]; then
36-
yarn install --immutable
33+
if [ -f "pnpm-lock.yaml" ]; then
34+
pnpm install
35+
elif [ -f "package-lock.json" ]; then
36+
npm install
3737
else
38-
yarn install --frozen-lockfile
38+
yarn_version=$(yarn --version)
39+
yarn_version_major=${yarn_version:0:1}
40+
41+
if [ "${yarn_version_major}" = '1' ]; then
42+
yarn install --immutable
43+
else
44+
yarn install --frozen-lockfile
45+
fi
3946
fi
47+
48+
4049
# TODO Do not assume that dripip is locally installed.
4150
- name: Publish Release
4251
shell: bash

0 commit comments

Comments
 (0)