#!/bin/sh
# Forced command for the CI key (authorized_keys of user "deployer"). The only accepted request is
#   deploy <40-hex sha>
# Anything else (a shell, scp, other commands) is refused.
set -euf
set -- ${SSH_ORIGINAL_COMMAND:-}
if [ "$#" -eq 2 ] && [ "$1" = deploy ]; then
  exec sudo -n /usr/local/sbin/workshare-deploy "$2"
fi
echo "this key can only deploy" >&2
exit 1
