diff --git a/action.yml b/action.yml index 5324ffa..fe0bc58 100644 --- a/action.yml +++ b/action.yml @@ -1,18 +1,18 @@ -name: 'Version' -description: 'A tool to handle version numbers' +name: "Version" +description: "A tool to handle version numbers" inputs: version: - description: 'Explicit version to use (e.g. v0.1.5). Defaults to the action tag.' + description: "Explicit version to use (e.g. v0.1.5). Defaults to the action tag." required: false command: - description: 'Command to run (bump or latest)' + description: "Command to run (bump or latest)" required: true args: - description: 'Arguments to pass to the command' + description: "Arguments to pass to the command" required: true outputs: version: - description: 'The output of the command' + description: "The output of the command" value: ${{ steps.version-cli.outputs.version }} runs: using: "composite" @@ -26,7 +26,7 @@ runs: run: | # If input is empty, fall back to the action's pinned tag (e.g., v0.1.5) VERSION="${INPUT_VERSION:-$ACTION_REF}" - + if [[ "$VERSION" =~ ^[0-9a-f]{40}$ ]]; then echo "::error::When pinning by SHA, you must explicitly provide the 'version' input." echo "Please update your workflow:" @@ -35,12 +35,12 @@ runs: echo " version: v0.1.5 # <--- Required" exit 1 fi - + if [ -z "$VERSION" ]; then echo "Error: Could not determine version. Please pin the action or provide a version input." exit 1 fi - + echo "Resolved version: $VERSION" # --- 2. MAP OS & ARCH --- @@ -66,14 +66,14 @@ runs: # --- 3. CONSTRUCT URL --- FILENAME="version_${OS_TYPE}_${ARCH_TYPE}.tar.gz" URL="https://github.com/version-cli/version/releases/download/${VERSION}/${FILENAME}" - + echo "Downloading from: $URL" # --- 4. DOWNLOAD & INSTALL --- curl -sLf -H "Authorization: Bearer $GITHUB_TOKEN" "$URL" -o "version.tar.gz" mkdir -p "$HOME/.local/bin" - + tar -xzf "version.tar.gz" -C "$HOME/.local/bin" "$BINARY_NAME" # --- 5. UPDATE PATH --- @@ -87,5 +87,8 @@ runs: COMMAND: ${{ inputs.command }} ARGS: ${{ inputs.args }} run: | - OUTPUT=$(version "$COMMAND" $ARGS) - echo "version=$OUTPUT" >> $GITHUB_OUTPUT + { + echo "version<> "$GITHUB_OUTPUT"