scripts: match upstream remote case-insensitively in tag-release.sh
What changed, and why it matters
This is a tiny developer-tooling fix in a release helper script. It makes the script recognize GitHub remotes even when the repository owner name uses uppercase letters (e.g., 'LightningNetwork/lnd' instead of 'lightningnetwork/lnd'). It does not change any code that handles money, network messages, cryptography, or user data, and it does not create a security vulnerability.
No security action needed. Treat as a normal developer-experience fix.
Security signals we found
No security-relevant code paths modified
No input from untrusted users processed at runtime
No cryptographic, network, or consensus logic changed
No privilege escalation or code execution vector introduced
Evidence from the diff
The patch modifies scripts/tag-release.sh to lowercase the remote URL with awk’s tolower() before matching against a canonical lower-case regex for ‘lightningnetwork/lnd’. This prevents the script from incorrectly failing when a remote uses a mixed-case GitHub owner name. The change is purely in shell/awk string handling for release automation and has no effect on lnd’s runtime, RPC, wallet, or network behavior.
Changed components
scripts/tag-release.shInspect captured patch +5 / −2
diff --git a/scripts/tag-release.sh b/scripts/tag-release.sh
index d07e02c..1f1db8f 100755
--- a/scripts/tag-release.sh
+++ b/scripts/tag-release.sh
@@ -12,7 +12,10 @@ VERSION_FILE="build/version.go"
# Match the canonical upstream URL across https / git@ / ssh:// forms, with or
# without a `.git` suffix. We identify the remote by URL because `origin` is
-# conventionally the fork in a `gh repo fork` setup.
+# conventionally the fork in a `gh repo fork` setup. The URL is lower-cased
+# before matching (see below), so this pattern stays lower-case: GitHub treats
+# the org/repo as case-insensitive, and `origin` is often the mixed-case
+# `LightningNetwork/lnd`.
UPSTREAM_URL_REGEX='[:/]lightningnetwork/lnd(\.git)?$'
usage() {
@@ -59,7 +62,7 @@ UPSTREAM_REMOTES=()
while IFS= read -r line; do
UPSTREAM_REMOTES+=("$line")
done < <(git remote -v | awk -v re="${UPSTREAM_URL_REGEX}" \
- '$3 == "(fetch)" && $2 ~ re { print $1 }' | sort -u)
+ '$3 == "(fetch)" && tolower($2) ~ re { print $1 }' | sort -u)
case "${#UPSTREAM_REMOTES[@]}" in
0) echo "Error: no git remote points at lightningnetwork/lnd. Add one with" \
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.