Check each OpenSSH tool on its own and stop only an agent this job started
CI / Linux checks (pull_request) Failing after 21m18s

command -v with two names returns 0 when one resolves, so the guards were
weaker than they read. The release workflow's final step killed whatever agent
SSH_AGENT_PID named; it now needs the marker the start step writes after it
succeeded. Two documentation lines re-wrapped (the review's three minors).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Fable 5.1 committed 2026-10-24 14:24:19 +03:00
1 parent e5956e40e9
commit b8ba43f0c9
4 files changed
+17 -9

No files matched your search

+6 -4
View File
@@ -26,10 +26,12 @@ runs:
echo "::error::The VoelinProtocol deploy key is empty. Set the repository secret VOELIN_PROTOCOL_DEPLOY_KEY to the private key of the read-only deploy key on Voelin/VoelinProtocol (docs/ci.md, VoelinProtocol access). Pull requests from forks get no secrets." >&2
exit 1
fi
command -v ssh ssh-keygen > /dev/null || {
echo "::error::The job image needs the OpenSSH client (ssh, ssh-keygen)." >&2
exit 1
}
for tool in ssh ssh-keygen; do
command -v "$tool" > /dev/null || {
echo "::error::The job image needs the OpenSSH client: $tool is missing." >&2
exit 1
}
done
ssh_dir="$HOME/.ssh"
key_file="$ssh_dir/voelin_protocol"
mkdir -p "$ssh_dir"
+6 -2
View File
@@ -46,7 +46,9 @@ jobs:
echo "::error::The repository secret VOELIN_PROTOCOL_DEPLOY_KEY is missing or empty. It holds the private key of the read-only deploy key on Voelin/VoelinProtocol (docs/ci.md, VoelinProtocol access)." >&2
exit 1
fi
command -v ssh-agent ssh-add > /dev/null
for tool in ssh-agent ssh-add; do
command -v "$tool" > /dev/null || { echo "::error::The runner needs the OpenSSH client: $tool is missing." >&2; exit 1; }
done
eval "$(ssh-agent -s -t 32400)" > /dev/null
started=
trap '[[ -n "$started" ]] || ssh-agent -k > /dev/null' EXIT
@@ -58,6 +60,8 @@ jobs:
{
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK"
echo "SSH_AGENT_PID=$SSH_AGENT_PID"
# Only an agent this job started is stopped at the end.
echo "VOELIN_AGENT_STARTED=1"
} >> "$GITHUB_ENV"
started=1
- name: Linux packages
@@ -135,6 +139,6 @@ jobs:
- name: Stop the ssh-agent
if: always()
run: |
if [[ -n "${SSH_AGENT_PID:-}" ]]; then
if [[ -n "${VOELIN_AGENT_STARTED:-}" && -n "${SSH_AGENT_PID:-}" ]]; then
ssh-agent -k > /dev/null || true
fi
+2 -1
View File
@@ -81,7 +81,8 @@ scripts/docker-build.sh android # → dist/android/
scripts/docker-build.sh # all three
```
The same with plain Docker, e.g. `docker build --ssh default -f docker/linux.Dockerfile -o dist/linux .`
The same with plain Docker, e.g. `docker build --ssh default -f docker/linux.Dockerfile -o dist/linux .`.
**The builds need an ssh-agent that holds a key able to read the private
VoelinProtocol repository** ([below](#depending-on-voelinprotocol)): Cargo
fetches it inside the image, through the agent that `--ssh default` hands to the
+3 -2
View File
@@ -206,8 +206,9 @@ voelin-release:host
```
Provision Bash, Git, the OpenSSH client (`ssh-agent` and `ssh-add`), Node.js
20+, Python 3.11+, curl, tar, gzip and rootful Docker 23+ with BuildKit. Use **act_runner 0.2.7 or newer** (prefer the latest
maintained release), or gitea-runner 2+. Older act_runner does not provide
20+, Python 3.11+, curl, tar, gzip and rootful Docker 23+ with BuildKit. Use
**act_runner 0.2.7 or newer** (prefer the latest maintained release), or
gitea-runner 2+. Older act_runner does not provide
`ACTIONS_RESULTS_URL`, which the pinned artifact action needs. Register the
runner against `https://git.faumaray.ru`, reachable from both the host and
build containers. Gitea 1.25.4 provides the required artifact-v4 API.