Skip to content

Commit

Permalink
fix(action): do not assume yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Jul 31, 2022
1 parent d4d908d commit 3ae1656
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ runs:
echo "Could not detect which package manager is being used."
exit 1
fi
# TODO Do not assume that dripip is locally installed.
- name: Publish Release
Expand All @@ -54,18 +53,28 @@ runs:
NPM_TOKEN: ${{inputs.npmToken}}
GITHUB_TOKEN: ${{inputs.githubToken}}
run: |
yarn_version=$(yarn --version)
yarn_version_major=${yarn_version:0:1}
if [ "${yarn_version_major}" = '1' ]; then
silent_flag='--silent'
else
silent_flag=''
fi
if [ '${{inputs.isStable}}' = 'true' ]; then
sub_command='stable'
else
sub_command='preview-or-pr'
fi
yarn ${silent_flag} dripip ${sub_command} --json ${{inputs.extraFlags}}
if [ -f "pnpm-lock.yaml" ]; then
pnpm dripip ${sub_command} --json ${{inputs.extraFlags}}
elif [ -f "package-lock.json" ]; then
npx dripip ${sub_command} --json ${{inputs.extraFlags}}
elif [ -f "yarn.lock" ]; then
yarn_version=$(yarn --version)
yarn_version_major=${yarn_version:0:1}
if [ "${yarn_version_major}" = '1' ]; then
silent_flag='--silent'
else
silent_flag=''
fi
yarn ${silent_flag} dripip ${sub_command} --json ${{inputs.extraFlags}}
else
echo "Could not detect which package manager is being used."
exit 1
fi

0 comments on commit 3ae1656

Please sign in to comment.