Commit b725f7bea2

b725f7bea2d0a0f9abbc93dbbd9e1282f7e058a8

parent: 993d523ea9

Unsigned

Wraient <wraient.911@gmail.com> · 2025-08-26 22:40 UTC

ci/cd: fix again :)

Layout: unified · split

.github/workflows/update-aur.yml +47 −16
@@ -38,6 +38,8 @@ jobs:
3838 sudo apt-get install -y expect git sshpass
3939
4040 - name: Set up SSH for AUR
41 env:
42 SSH_PASSPHRASE: "sex"
4143 run: |
4244 mkdir -p ~/.ssh
4345 # Write the SSH key, ensuring proper formatting
@@ -56,38 +58,67 @@ jobs:
5658 IdentitiesOnly yes
5759 EOF
5860
61 # Add AUR host key to known_hosts
62 ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts
63
5964 # Start SSH agent and add key with passphrase
6065 eval $(ssh-agent -s)
6166 echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
6267 echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
6368
64 # Use expect to add the key with passphrase
69 # Debug: Check key format
70 echo "Checking SSH key format..."
71 head -1 ~/.ssh/aur_rsa
72
73 # Try alternative method using expect with better error handling
6574 expect -c "
66 set timeout 10
75 set timeout 20
76 log_user 1
6777 spawn ssh-add ~/.ssh/aur_rsa
6878 expect {
69 \"Enter passphrase\" {
70 send \"sex\r\"
71 exp_continue
79 \"Enter passphrase*\" {
80 send \"$env(SSH_PASSPHRASE)\r\"
81 expect {
82 \"Identity added*\" {
83 puts \"SUCCESS: Key added to agent\"
84 exit 0
85 }
86 \"Bad passphrase*\" {
87 puts \"ERROR: Bad passphrase\"
88 exit 1
89 }
90 timeout {
91 puts \"ERROR: Timeout after entering passphrase\"
92 exit 1
93 }
94 }
7295 }
73 \"Identity added\" {
74 puts \"Key successfully added\"
96 \"*already loaded*\" {
97 puts \"Key already loaded\"
98 exit 0
7599 }
76 \"Bad passphrase\" {
77 puts \"Bad passphrase\"
100 timeout {
101 puts \"ERROR: Timeout waiting for passphrase prompt\"
78102 exit 1
79103 }
80 timeout {
81 puts \"Timeout waiting for passphrase prompt\"
104 eof {
105 puts \"Unexpected end of file\"
82106 exit 1
83107 }
84 eof
85108 }
86 "
109 " || {
110 echo "Expect failed, trying alternative method..."
111 # Alternative: try with DISPLAY set to avoid GUI prompts
112 DISPLAY=:0 SSH_ASKPASS_REQUIRE=never ssh-add ~/.ssh/aur_rsa 2>&1 || echo "Alternative method also failed"
113 }
114
115 # Verify key is loaded
116 echo "Checking loaded keys:"
117 ssh-add -l 2>&1 || echo "No keys in agent"
87118
88 # Test SSH connection (output suppressed for security)
89 echo "Testing SSH connection to AUR..."
90 ssh -T aur@aur.archlinux.org >/dev/null 2>&1 && echo "SSH connection successful" || echo "SSH connection failed (this might be normal for AUR)"
119 # Test connection with verbose output for debugging
120 echo "Testing SSH connection with verbose output:"
121 ssh -vT aur@aur.archlinux.org 2>&1 | head -20 || echo "SSH test completed"
91122
92123 - name: Clone AUR repository
93124 run: |