File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6666 if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
6767 echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
6868 elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
69- VERSION="v$(node -p "require('./package.json').version" 2>/dev/null || echo "0.0.0")"
70- if [ "$VERSION" = "vundefined" ] || [ "$VERSION" = "v" ]; then
71- echo "Error: Unable to extract version from package.json"
69+ if [ ! -f package.json ]; then
70+ echo "Error: package.json not found"
71+ exit 1
72+ fi
73+ VERSION="v$(node -p "require('./package.json').version" 2>/dev/null)"
74+ if [ -z "$VERSION" ] || [ "$VERSION" = "v" ] || [ "$VERSION" = "vundefined" ] || [ "$VERSION" = "vnull" ]; then
75+ echo "Error: Unable to extract valid version from package.json"
7276 exit 1
7377 fi
7478 echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments