Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: filter release keys to reduce interactivity #55950

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
fixup! tools: filter release keys to reduce interactivity
aduh95 committed Nov 21, 2024
commit 42ea297733bd2eaf5baaeeead55c2cebc40492fd
4 changes: 2 additions & 2 deletions tools/release.sh
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ echo "# Selecting GPG key ..."
if [ -z "$allPGPKeys" ]; then
gpgkey="$(awk '{
if ($1 == "gpg" && $2 == "--keyserver" && $4 == "--recv-keys" && (1 == 2'"$(
gpg --list-secret-keys | awk -F' = ' '/^ +Key fingerprint/{ print " || $5 == \"" $2 "\"" }' | tr -d ' ' || true
gpg --list-secret-keys | awk -F' = ' '/^ +Key fingerprint/{ gsub(/ /,"",$2); print " || $5 == \"" $2 "\"" }' || true
)"')) { print substr($5, 33) }
}' "$readmePath")"
else
@@ -87,7 +87,7 @@ elif [ "$keycount" -ne 1 ]; then
gpgkey=$(echo "$gpgkey" | sed -n "${keynum}p")
fi

gpgfing=$(gpg --keyid-format 0xLONG --fingerprint "$gpgkey" | grep 'Key fingerprint =' | awk -F' = ' '{print $2}' | tr -d ' ')
gpgfing=$(gpg --keyid-format 0xLONG --fingerprint "$gpgkey" | awk -F' = ' '/^ +Key fingerprint/{gsub(/ /,"",$2);print $2}')

grep -q "$gpgfing" "$readmePath" || {
echo "Error: this GPG key fingerprint is not listed in $readmePath"