File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,21 @@ runs:
3737 using : " composite"
3838 steps :
3939 - name : Check for anaconda and pixi commands
40+ id : get_command
4041 shell : bash
4142 run : |
42- if ! command -v anaconda &> /dev/null; then
43- if ! command -v pixi &> /dev/null; then
44- echo "Error: Neither 'anaconda' nor 'pixi' command found. Please install the Anaconda Client or Pixi CLI to use this action."
45- exit 1
46- else
43+ # if `anaconda` command is available, use it directly; otherwise, check for `pixi` and install `anaconda-client` if needed
44+ if command -v anaconda &> /dev/null; then
45+ echo "'anaconda' command found. Using it for upload."
46+ echo "CMD=anaconda" >> $GITHUB_OUTPUT
47+ else
48+ if command -v pixi &> /dev/null; then
4749 echo "'pixi' command found. Installing anaconda-client via pixi..."
4850 pixi global install anaconda-client
51+ echo "CMD='pixi run anaconda'" >> $GITHUB_OUTPUT
52+ else
53+ echo "Error: Neither 'anaconda' nor 'pixi' command found. Please install the Anaconda Client or Pixi CLI to use this action."
54+ exit 1
4955 fi
5056 fi
5157
6167 run : |
6268 set -euo pipefail
6369
70+ set CMD=${{ steps.get_command.outputs.CMD }}
71+
6472 if [ "${LABEL}" = "" ]; then
6573 echo "No label input provided. Determining label from GitHub ref '${REF}'..."
6674 case "${REF}" in
8189 fi
8290
8391 echo "Uploading ${PACKAGE_PATH} to ${ORGANIZATION} with label '${LABEL}'"
84- anaconda \
92+ ${CMD} \
8593 --token "${ANACONDA_API_TOKEN}" \
8694 upload \
8795 --user "${ORGANIZATION}" \
You can’t perform that action at this time.
0 commit comments