1# A CI note's runner is never this machine's account@hostname, even when2# the forge user has the same name as the local account: the machine part3# is a made-up name, and the hostname appears nowhere in the note.4. "$(dirname "$0")/../lib.sh"5me=$(id -un)6host=$(hostname -s 2>/dev/null || hostname)7user "$me"8repo "$me/greet"9clone "$me" "$me/greet" "$T/w/d"10mkdir -p "$T/w/d/.forge"11printf '#!/bin/sh\ntrue\n' >"$T/w/d/.forge/ci"12chmod +x "$T/w/d/.forge/ci"13at "$T/w/d" commit "first"14at "$T/w/d" git config forge.user "$me"15export FORGE_USER=$me16ok at "$T/w/d" "$FORGE" attest17git -C "$T/w/d" notes --ref=ci show HEAD >"$T/note"18r=$(sed -n 's/^runner //p' "$T/note" | tail -n 1)19[ -n "$r" ] || fail "no runner in the note"20[ "$r" != "$me@$host" ] || fail "the runner is $me@$host"21case $r in "$me"@[a-z]*-[a-z]*-[0-9a-f][0-9a-f]) ;; *) fail "runner is '$r'" ;; esac22grep -v '^|' "$T/note" | grep -qiwF "$host" && fail "the note names the host $host"23true