0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2024-11-17 12:51:33 -05:00

Verify either commit or tag

This commit is contained in:
Adrian Dvergsdal 2020-07-15 22:24:28 +02:00
parent 3bc191cc6c
commit fcf9c8f1ac
No known key found for this signature in database
GPG key ID: C1E9E2D9552A42D2

View file

@ -21,7 +21,12 @@ jobs:
# Only allow commits signed by owner
- name: Verify commit signature
run: |
if git verify-commit --raw HEAD 2>&1 | grep -e VALIDSIG | grep -q "$GPG_KEY_FINGERPRINT"; then
verify_head() {
( git verify-commit --raw HEAD || git verify-tag --raw $(git tag --points-at HEAD) ) 2>&1 \
| grep -e VALIDSIG | grep -q "$1"
}
if verify_head "$GPG_KEY_FINGERPRINT"; then
echo "Verified signature from $GPG_KEY_FINGERPRINT"
else
echo "Missing signature by $GPG_KEY_FINGERPRINT"