Skip to content

Commit 45c4252

Browse files
committed
Update run.sh script with improved error handling, complete dependencies, and debug statements
1 parent e21b02c commit 45c4252

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

leap-catalog/action.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,29 @@ outputs: {}
2222
runs:
2323
using: "composite"
2424
steps:
25-
- run: ${{ github.workspace }}/leap-catalog/run.sh "${{ inputs.version }}" "${{ inputs.validation-path }}" "${{ inputs.single-feedstock }}" "${{ inputs.generation-path }}" "${{ inputs.output-directory }}"
26-
shell: bash
25+
- run: |
26+
27+
echo "🔄 Initializing LEAP Catalog Action..."
28+
echo "Arguments: version=$1, validation-path=$2, single-feedstock=$3, generation-path=$4, output-directory=$5"
29+
30+
echo "🔍 Installing package version: $1"
31+
python -m pip install "leap-data-management-utils[complete]==$1" || { echo "Specific version installation failed"; exit 1; }
32+
33+
34+
# Validate or generate based on input arguments
35+
if [ -n "$3" ]; then
36+
echo "🔍 Validating single feedstock: $3"
37+
leap-catalog validate --single "$3" || { echo "Validation failed for single feedstock"; exit 1; }
38+
elif [ -n "$2" ]; then
39+
echo "🔍 Validating feedstocks from: $2"
40+
leap-catalog validate --path "$2" || { echo "Validation failed for feedstocks"; exit 1; }
41+
elif [ -n "$4" ] && [ -n "$5" ]; then
42+
echo "🔍 Generating catalog from: $4 to $5"
43+
leap-catalog generate --path "$4" --output "$5" || { echo "Catalog generation failed"; exit 1; }
44+
else
45+
echo "⚠️ No valid action specified. Please check input parameters."
46+
exit 1
47+
fi
48+
49+
exit 0
50+
shell: bash -e {0}

0 commit comments

Comments
 (0)