Skip to content

Commit 3ae1656

Browse files
committed
fix(action): do not assume yarn
1 parent d4d908d commit 3ae1656

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

action.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ runs:
4545
echo "Could not detect which package manager is being used."
4646
exit 1
4747
fi
48-
4948
5049
# TODO Do not assume that dripip is locally installed.
5150
- name: Publish Release
@@ -54,18 +53,28 @@ runs:
5453
NPM_TOKEN: ${{inputs.npmToken}}
5554
GITHUB_TOKEN: ${{inputs.githubToken}}
5655
run: |
57-
yarn_version=$(yarn --version)
58-
yarn_version_major=${yarn_version:0:1}
59-
if [ "${yarn_version_major}" = '1' ]; then
60-
silent_flag='--silent'
61-
else
62-
silent_flag=''
63-
fi
64-
6556
if [ '${{inputs.isStable}}' = 'true' ]; then
6657
sub_command='stable'
6758
else
6859
sub_command='preview-or-pr'
6960
fi
7061
71-
yarn ${silent_flag} dripip ${sub_command} --json ${{inputs.extraFlags}}
62+
if [ -f "pnpm-lock.yaml" ]; then
63+
pnpm dripip ${sub_command} --json ${{inputs.extraFlags}}
64+
elif [ -f "package-lock.json" ]; then
65+
npx dripip ${sub_command} --json ${{inputs.extraFlags}}
66+
elif [ -f "yarn.lock" ]; then
67+
yarn_version=$(yarn --version)
68+
yarn_version_major=${yarn_version:0:1}
69+
70+
if [ "${yarn_version_major}" = '1' ]; then
71+
silent_flag='--silent'
72+
else
73+
silent_flag=''
74+
fi
75+
76+
yarn ${silent_flag} dripip ${sub_command} --json ${{inputs.extraFlags}}
77+
else
78+
echo "Could not detect which package manager is being used."
79+
exit 1
80+
fi

0 commit comments

Comments
 (0)