Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: "embed-src"
description: "A GitHub Action that embeds source files into any text file."
author: "urmzd"
branding:
icon: "file"
color: "gray-dark"
Expand Down Expand Up @@ -66,7 +67,15 @@ runs:
esac

BINARY_NAME="embed-src-${TARGET}"
DOWNLOAD_URL="https://github.com/urmzd/embed-src/releases/latest/download/${BINARY_NAME}"
# Derive the major version tag from this action's ref (e.g. v3.4.0 -> v3)
# Falls back to "latest" if the ref isn't a semver tag.
ACTION_REF="${GITHUB_ACTION_REF:-latest}"
if [[ "$ACTION_REF" =~ ^v([0-9]+) ]]; then
FLOAT_TAG="v${BASH_REMATCH[1]}"
else
FLOAT_TAG="latest"
fi
DOWNLOAD_URL="https://github.com/urmzd/embed-src/releases/download/${FLOAT_TAG}/${BINARY_NAME}"

INSTALL_DIR="$HOME/.local/bin"
mkdir -p "$INSTALL_DIR"
Expand Down
Loading