1- name : ' Version'
2- description : ' A tool to handle version numbers'
1+ name : " Version"
2+ description : " A tool to handle version numbers"
33inputs :
44 version :
5- description : ' Explicit version to use (e.g. v0.1.5). Defaults to the action tag.'
5+ description : " Explicit version to use (e.g. v0.1.5). Defaults to the action tag."
66 required : false
77 command :
8- description : ' Command to run (bump or latest)'
8+ description : " Command to run (bump or latest)"
99 required : true
1010 args :
11- description : ' Arguments to pass to the command'
11+ description : " Arguments to pass to the command"
1212 required : true
1313outputs :
1414 version :
15- description : ' The output of the command'
15+ description : " The output of the command"
1616 value : ${{ steps.version-cli.outputs.version }}
1717runs :
1818 using : " composite"
2626 run : |
2727 # If input is empty, fall back to the action's pinned tag (e.g., v0.1.5)
2828 VERSION="${INPUT_VERSION:-$ACTION_REF}"
29-
29+
3030 if [[ "$VERSION" =~ ^[0-9a-f]{40}$ ]]; then
3131 echo "::error::When pinning by SHA, you must explicitly provide the 'version' input."
3232 echo "Please update your workflow:"
@@ -35,12 +35,12 @@ runs:
3535 echo " version: v0.1.5 # <--- Required"
3636 exit 1
3737 fi
38-
38+
3939 if [ -z "$VERSION" ]; then
4040 echo "Error: Could not determine version. Please pin the action or provide a version input."
4141 exit 1
4242 fi
43-
43+
4444 echo "Resolved version: $VERSION"
4545
4646 # --- 2. MAP OS & ARCH ---
@@ -66,14 +66,14 @@ runs:
6666 # --- 3. CONSTRUCT URL ---
6767 FILENAME="version_${OS_TYPE}_${ARCH_TYPE}.tar.gz"
6868 URL="https://github.com/version-cli/version/releases/download/${VERSION}/${FILENAME}"
69-
69+
7070 echo "Downloading from: $URL"
7171
7272 # --- 4. DOWNLOAD & INSTALL ---
7373 curl -sLf -H "Authorization: Bearer $GITHUB_TOKEN" "$URL" -o "version.tar.gz"
7474
7575 mkdir -p "$HOME/.local/bin"
76-
76+
7777 tar -xzf "version.tar.gz" -C "$HOME/.local/bin" "$BINARY_NAME"
7878
7979 # --- 5. UPDATE PATH ---
8787 COMMAND : ${{ inputs.command }}
8888 ARGS : ${{ inputs.args }}
8989 run : |
90- OUTPUT=$(version "$COMMAND" $ARGS)
91- echo "version=$OUTPUT" >> $GITHUB_OUTPUT
90+ {
91+ echo "version<<EOF"
92+ version "$COMMAND" $ARGS
93+ echo "EOF"
94+ } >> "$GITHUB_OUTPUT"
0 commit comments