Skip to content

Commit 4b668ce

Browse files
committed
[gh] report success if the key is found in the debian keyring (even without an @debian.org address)
1 parent d4c2a54 commit 4b668ce

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/join.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Check Join Requests
23

34
on:
@@ -31,12 +32,16 @@ jobs:
3132
echo "fetching GPG key from keyring.debian.org..."
3233
gpg --homedir mygpg --keyserver keyring.debian.org --recv-keys "$key"
3334
debuser=$(gpg --homedir mygpg -k ${key} | grep -E "^uid[[:space:]].*@debian.org>" | sed -e 's|.*<\([^@]*\)@debian.org>.*|\1|' | head -1)
34-
echo "USER: ${debuser}"
35+
userid=$(gpg --homedir mygpg -k ${key} | grep -E "^uid[[:space:]].*\[" | sed -e 's|.*][[:space:]]*||' -e '/^[[:space:]]*$/d' | head -1)
36+
echo "primary USER: ${userid}"
37+
echo "Debian USER: ${debuser}"
3538
echo "verifying the signature..."
3639
gpg --homedir mygpg --verify file.txt
3740
echo "DEBUSER=${debuser}" >> $GITHUB_OUTPUT
41+
echo "USERID=${userid}" >> $GITHUB_OUTPUT
3842
outputs:
3943
deb-username: ${{ steps.gpg-check.outputs.DEBUSER }}
44+
pgp-userid: ${{ steps.gpg-check.outputs.USERID }}
4045

4146
decline:
4247
name: Decline membership
@@ -72,3 +77,19 @@ jobs:
7277
7378
Please stay tuned until some human administrator accepts your application.
7479
80+
otheremail:
81+
name: Debian Developer without @debian.org email
82+
runs-on: ubuntu-latest
83+
needs: ["keycheck"]
84+
if: "${{ needs.keycheck.outputs.deb-username == '' }}"
85+
steps:
86+
- name: Post username
87+
uses: peter-evans/create-or-update-comment@v2
88+
with:
89+
issue-number: ${{ github.event.issue.number }}
90+
body: |
91+
Your membership application was correctly PGP signed with a key that is in the Debian keyring :tada:,
92+
although there's no debian.org email associated with that key.
93+
The first user ID in the key is `${{ needs.keycheck.outputs.pgp-userid }}`.
94+
95+
Please stay tuned until some human administrator accepts your application.

0 commit comments

Comments
 (0)