fix: tighten the crates lock check, drop the key from child environments
crates-lock-check.sh anchors on `[/:]daniel/gitdan-crates(.git)?/?` and matches case-insensitively, so a trailing-slash or differently-cased second commit is counted and a look-alike owner (notdaniel/) is not. crates-access.sh unsets DEPLOY_KEY once the key file is written, so git, ssh and timeout no longer inherit it. README says three actions, not two. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MfBCVNDv3y5gm2djeZSAk4
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
#
|
||||
# Several packages from the one source share a commit, so what counts is
|
||||
# distinct commits, not entries. The query string (`?branch=main`, `?rev=...`)
|
||||
# is ignored, and so is the URL's spelling (scheme, port, `.git`): two copies
|
||||
# of the repo are two copies whichever way they were named. No entry passes.
|
||||
# is ignored, and so is the URL's spelling (scheme, port, `.git`, a trailing
|
||||
# slash, case): two copies of the repo are two copies whichever way they were
|
||||
# named. A look-alike owner or repo (`notdaniel/`, `gitdan-crates-extra`) is not
|
||||
# this source. No entry passes.
|
||||
set -euo pipefail
|
||||
|
||||
[ $# -eq 1 ] || { echo "::error::crates-lock-check: expected <path-to-Cargo.lock>" >&2; exit 1; }
|
||||
@@ -18,7 +20,7 @@ lock="$1"
|
||||
}
|
||||
|
||||
# source = "git+<url>[?query]#<sha>"
|
||||
shas=$(sed -nE 's#^source = "git\+[^"?\#]*daniel/gitdan-crates(\.git)?(\?[^"\#]*)?\#([^"]*)"$#\3#p' "$lock" | sort -u)
|
||||
shas=$(sed -nE 's#^source = "git\+[^"?\#]*[/:]daniel/gitdan-crates(\.git)?/?(\?[^"\#]*)?\#([^"]*)"$#\3#Ip' "$lock" | sort -u)
|
||||
count=$(grep -c . <<<"$shas" || true)
|
||||
|
||||
if [ "$count" -gt 1 ]; then
|
||||
|
||||
Reference in New Issue
Block a user