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:
38 sudo apt-get install -y expect git sshpass 38 sudo apt-get install -y expect git sshpass
39 39
40 - name: Set up SSH for AUR 40 - name: Set up SSH for AUR
41 env:
42 SSH_PASSPHRASE: "sex"
41 run: | 43 run: |
42 mkdir -p ~/.ssh 44 mkdir -p ~/.ssh
43 # Write the SSH key, ensuring proper formatting 45 # Write the SSH key, ensuring proper formatting
@@ -56,38 +58,67 @@ jobs:
56 IdentitiesOnly yes 58 IdentitiesOnly yes
57 EOF 59 EOF
58 60
61 # Add AUR host key to known_hosts
62 ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts
63
59 # Start SSH agent and add key with passphrase 64 # Start SSH agent and add key with passphrase
60 eval $(ssh-agent -s) 65 eval $(ssh-agent -s)
61 echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV 66 echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
62 echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV 67 echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
63 68
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
65 expect -c " 74 expect -c "
66 set timeout 10 75 set timeout 20
76 log_user 1
67 spawn ssh-add ~/.ssh/aur_rsa 77 spawn ssh-add ~/.ssh/aur_rsa
68 expect { 78 expect {
69 \"Enter passphrase\" { 79 \"Enter passphrase*\" {
70 send \"sex\r\" 80 send \"$env(SSH_PASSPHRASE)\r\"
71 exp_continue 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 }
72 } 95 }
73 \"Identity added\" { 96 \"*already loaded*\" {
74 puts \"Key successfully added\" 97 puts \"Key already loaded\"
98 exit 0
75 } 99 }
76 \"Bad passphrase\" { 100 timeout {
77 puts \"Bad passphrase\" 101 puts \"ERROR: Timeout waiting for passphrase prompt\"
78 exit 1 102 exit 1
79 } 103 }
80 timeout { 104 eof {
81 puts \"Timeout waiting for passphrase prompt\" 105 puts \"Unexpected end of file\"
82 exit 1 106 exit 1
83 } 107 }
84 eof
85 } 108 }
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"
87 118
88 # Test SSH connection (output suppressed for security) 119 # Test connection with verbose output for debugging
89 echo "Testing SSH connection to AUR..." 120 echo "Testing SSH connection with verbose output:"
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)" 121 ssh -vT aur@aur.archlinux.org 2>&1 | head -20 || echo "SSH test completed"
91 122
92 - name: Clone AUR repository 123 - name: Clone AUR repository
93 run: | 124 run: |