diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 171f19a..1bb3302 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -443,7 +443,7 @@ jobs: gpg --import --import-options show-only --with-fingerprint samoyed-release-public.key # Verify fingerprint matches expected value (normalize spacing) - ACTUAL_FINGERPRINT=$(gpg --import --import-options show-only --with-fingerprint samoyed-release-public.key | grep -E '^\s+[0-9A-F]{4} [0-9A-F]{4}' | tr -s ' ' | xargs) + ACTUAL_FINGERPRINT=$(gpg --import --import-options show-only --with-fingerprint samoyed-release-public.key | grep -E '^\s+([0-9A-F]{4}\s*){10}' | tr -s ' ' | xargs) EXPECTED_FINGERPRINT="${{ vars.GPG_FINGERPRINT }}" echo "Expected: ${EXPECTED_FINGERPRINT}" @@ -700,9 +700,17 @@ jobs: # Import public key gpg --import samoyed-release-public.key - # Verify key fingerprint - if ! gpg --fingerprint ${{ vars.FULL_GPG_KEY_ID }} | grep -q "${{ vars.GPG_FINGERPRINT }}"; then + # Verify key fingerprint (normalize spacing) + ACTUAL_FINGERPRINT=$(gpg --fingerprint ${{ vars.FULL_GPG_KEY_ID }} | grep -E '^\s+([0-9A-F]{4}\s*){10}' | tr -s ' ' | xargs) + EXPECTED_FINGERPRINT="${{ vars.GPG_FINGERPRINT }}" + + echo "Expected: ${EXPECTED_FINGERPRINT}" + echo "Actual: ${ACTUAL_FINGERPRINT}" + + if [[ "${ACTUAL_FINGERPRINT}" != "${EXPECTED_FINGERPRINT}" ]]; then echo "❌ Public key fingerprint verification failed" + echo "Expected: ${EXPECTED_FINGERPRINT}" + echo "Actual: ${ACTUAL_FINGERPRINT}" exit 1 fi echo "✅ Public key fingerprint verified" diff --git a/Cargo.lock b/Cargo.lock index 8f82ffb..9dab1f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -531,7 +531,7 @@ dependencies = [ [[package]] name = "samoyed" -version = "0.1.14" +version = "0.1.15" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index db0b457..c11320e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "samoyed" -version = "0.1.14" +version = "0.1.15" authors = ["Behrang Saeedzadeh "] edition = "2024" rust-version = "1.88.0"